source: extensions/ContactForm/config.php @ 17390

Last change on this file since 17390 was 17182, checked in by plg, 12 years ago

fix bugs introduced by Piwigo 2.4.2

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$config_tabs[]='persoform';
11
12global $template, $page;
13// Include language advices
14load_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
20if (!isset($_GET['tab'])) {
21    $page['tab'] = $config_tabs[0];
22} else {
23    $page['tab'] = $_GET['tab'];
24}
25
26if (!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
33foreach ($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.'&amp;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$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$template->block_html_head( '',
51          '<script type="text/javascript" '.
52          'src="' . CF_INCLUDE . 'contactform.js' . '">'.
53          '</script>');
54$template->set_filenames(array(
55    'plugin_admin_content' => realpath(cf_get_template('cf_'.
56                                                       $page['tab'].
57                                                       '.tab.tpl',
58                                                       CF_AMDIN_TPL))
59  ));
60
61$cf = array(
62    'TITLE'     => $cf_plugin->get_title(),
63    'F_ACTION'  => '',
64  );
65$template->assign('CF', $cf);
66
67// Include specific tab
68include_once (CF_ADMIN . 'cf_' . $page['tab'] . '.tab.php');
69
70$template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
71CF_Log::show_messages();
72?>
Note: See TracBrowser for help on using the repository browser.