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