source: extensions/ContactForm/config.php @ 3743

Last change on this file since 3743 was 3743, checked in by Criss, 15 years ago

Put under SVN control
Add obsolete list
Add language configuration for items texts
Add template variable

File size: 2.1 KB
Line 
1<?php
2/* $Id: config.php,v 1.1 2009/08/17 07:35:35 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
7$config_tabs[]='config';
8$config_tabs[]='language';
9
10global $template, $page;
11// Include language advices
12load_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
18if (!isset($_GET['tab'])) {
19    $page['tab'] = $config_tabs[0];
20} else {
21    $page['tab'] = $_GET['tab'];
22}
23
24if (!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
31foreach ($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.'&amp;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
65include_once (CF_ADMIN . 'cf_' . $page['tab'] . '.tab.php');
66
67$template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
68
69?>
Note: See TracBrowser for help on using the repository browser.