source: extensions/ContactForm/config.php @ 8905

Last change on this file since 8905 was 8482, checked in by Gotcha, 13 years ago

Daily MAJ

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