1 | <?php |
---|
2 | /* $Id: config.php,v 1.1 2009/08/17 07:35:35 Criss Exp $ */ |
---|
3 | if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); |
---|
4 | check_status(ACCESS_ADMINISTRATOR); |
---|
5 | include_once(PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php'); |
---|
6 | |
---|
7 | $config_tabs[]='config'; |
---|
8 | $config_tabs[]='language'; |
---|
9 | |
---|
10 | global $template, $page; |
---|
11 | // Include language advices |
---|
12 | load_language('plugin.lang', CF_PATH); |
---|
13 | |
---|
14 | $cf_plugin = get_plugin_data($plugin_id); |
---|
15 | $cf_config = $cf_plugin->get_config(); |
---|
16 | |
---|
17 | // Tabs management |
---|
18 | if (!isset($_GET['tab'])) { |
---|
19 | $page['tab'] = $config_tabs[0]; |
---|
20 | } else { |
---|
21 | $page['tab'] = $_GET['tab']; |
---|
22 | } |
---|
23 | |
---|
24 | if (!in_array($page['tab'], $config_tabs)) { |
---|
25 | $page['tab'] = $config_tabs[0]; |
---|
26 | } |
---|
27 | $base_admin_url = get_admin_plugin_menu_link(__FILE__); |
---|
28 | |
---|
29 | $tabsheet = new tabsheet(); |
---|
30 | |
---|
31 | foreach ($config_tabs as $current_tab) { |
---|
32 | $tab_name = 'cf_tab_'.$current_tab; |
---|
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 template file |
---|
41 | $template->block_html_head( '', |
---|
42 | '<link rel="stylesheet" type="text/css" '. |
---|
43 | 'href="' . CF_INCLUDE . 'contactform.css' . '">', |
---|
44 | $smarty, $repeat); |
---|
45 | $template->block_html_head( '', |
---|
46 | '<script type="text/javascript" '. |
---|
47 | 'src="' . CF_INCLUDE . 'contactform.js' . '">'. |
---|
48 | '</script>', |
---|
49 | $smarty, $repeat); |
---|
50 | $template->set_filenames(array( |
---|
51 | 'plugin_admin_content' => realpath(cf_get_template('cf_'. |
---|
52 | $page['tab']. |
---|
53 | '.tab.tpl', |
---|
54 | CF_AMDIN_TPL)) |
---|
55 | )); |
---|
56 | |
---|
57 | $cf = array( |
---|
58 | 'TITLE' => $cf_plugin->get_title(), |
---|
59 | 'VERSION' => $cf_plugin->get_version(), |
---|
60 | 'F_ACTION' => '', |
---|
61 | ); |
---|
62 | $template->assign('CF', $cf); |
---|
63 | |
---|
64 | // Include specific tab |
---|
65 | include_once (CF_ADMIN . 'cf_' . $page['tab'] . '.tab.php'); |
---|
66 | |
---|
67 | $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content'); |
---|
68 | |
---|
69 | ?> |
---|