source: extensions/ContactForm/config.php @ 7626

Last change on this file since 7626 was 6547, checked in by Gotcha, 14 years ago

v1.0.9

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