source: extensions/ContactForm/config.php @ 13741

Last change on this file since 13741 was 9070, checked in by plg, 13 years ago

feature 2180: remove the localization configuration tab

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