[3462] | 1 | <?php |
---|
[3473] | 2 | /* $Id: administration.php,v 1.3 2009/06/29 11:43:18 Criss Exp $ */ |
---|
[3462] | 3 | if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); |
---|
| 4 | include_once(PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php'); |
---|
| 5 | |
---|
| 6 | $config_tabs[]='config'; |
---|
| 7 | |
---|
| 8 | global $template, $page; |
---|
| 9 | // Include language advices |
---|
| 10 | load_language('plugin.lang', CE_PATH); |
---|
| 11 | |
---|
| 12 | $ce_plugin = get_plugin_data($plugin_id); |
---|
| 13 | $ce_config = $ce_plugin->getConfig(); |
---|
| 14 | |
---|
| 15 | // Tabs management |
---|
| 16 | if (!isset($_GET['tab'])) { |
---|
| 17 | $page['tab'] = $config_tabs[0]; |
---|
| 18 | } else { |
---|
| 19 | $page['tab'] = $_GET['tab']; |
---|
| 20 | } |
---|
| 21 | |
---|
| 22 | if (!in_array($page['tab'], $config_tabs)) { |
---|
| 23 | $page['tab'] = $config_tabs[0]; |
---|
| 24 | } |
---|
| 25 | |
---|
| 26 | |
---|
| 27 | $base_admin_url = get_admin_plugin_menu_link(__FILE__); |
---|
| 28 | |
---|
| 29 | $tabsheet = new tabsheet(); |
---|
| 30 | |
---|
| 31 | foreach ($config_tabs as $current_tab) { |
---|
[3465] | 32 | $tab_name = 'ce_tab_'.$current_tab; |
---|
[3462] | 33 | $tabsheet->add($current_tab, |
---|
| 34 | l10n($tab_name), |
---|
| 35 | $base_admin_url.'&tab='.$current_tab); |
---|
| 36 | } |
---|
| 37 | $tabsheet->select($page['tab']); |
---|
| 38 | $tabsheet->assign(); |
---|
| 39 | |
---|
| 40 | // Define common values |
---|
| 41 | $template->set_filenames(array( |
---|
| 42 | 'plugin_admin_content' => CE_AMDIN_TPL |
---|
| 43 | . $page['tab'] |
---|
| 44 | . '.tab.tpl' |
---|
| 45 | ) |
---|
| 46 | ); |
---|
| 47 | |
---|
| 48 | |
---|
| 49 | // Define common values |
---|
| 50 | $ce_common = array( |
---|
[3473] | 51 | 'version' => $ce_plugin->getVersion(), |
---|
[3462] | 52 | 'title' => $ce_plugin->plugin_id, |
---|
| 53 | ); |
---|
| 54 | $template->assign('CE', $ce_common); |
---|
| 55 | |
---|
| 56 | // Include specific tab |
---|
| 57 | include_once (CE_ADMIN . $page['tab'] . '.tab.php'); |
---|
| 58 | |
---|
| 59 | $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content'); |
---|
| 60 | |
---|
| 61 | ?> |
---|