1 | <?php |
---|
2 | if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); |
---|
3 | global $template, $conf, $user; |
---|
4 | include_once(PHPWG_ROOT_PATH .'admin/include/tabsheet.class.php'); |
---|
5 | load_language('plugin.lang', PFT_PATH); |
---|
6 | $my_base_url = get_admin_plugin_menu_link(__FILE__); |
---|
7 | |
---|
8 | // +-----------------------------------------------------------------------+ |
---|
9 | // | Check Access and exit when user status is not ok | |
---|
10 | // +-----------------------------------------------------------------------+ |
---|
11 | check_status(ACCESS_ADMINISTRATOR); |
---|
12 | |
---|
13 | //-------------------------------------------------------- sections definitions |
---|
14 | |
---|
15 | if (!is_webmaster()) |
---|
16 | { |
---|
17 | array_push($page['errors'], l10n('This section is reserved for the webmaster')); |
---|
18 | } |
---|
19 | else |
---|
20 | { |
---|
21 | |
---|
22 | // Gestion des onglets |
---|
23 | if (!isset($_GET['tab'])) |
---|
24 | $page['tab'] = 'gest'; |
---|
25 | else |
---|
26 | $page['tab'] = $_GET['tab']; |
---|
27 | |
---|
28 | $tabsheet = new tabsheet(); |
---|
29 | $tabsheet->add('gest', |
---|
30 | l10n('pft_tab_gest'), |
---|
31 | $my_base_url.'&tab=gest'); |
---|
32 | $tabsheet->add('help', |
---|
33 | l10n('pft_tab_help'), |
---|
34 | $my_base_url.'&tab=help'); |
---|
35 | $tabsheet->select($page['tab']); |
---|
36 | $tabsheet->assign(); |
---|
37 | |
---|
38 | // Onglet gest |
---|
39 | switch ($page['tab']) |
---|
40 | { |
---|
41 | case 'gest': |
---|
42 | |
---|
43 | $template->assign('gestA', |
---|
44 | array('PFTBASE' => $conf['persoFooter'],)); |
---|
45 | |
---|
46 | if (isset($_POST['submitpft'])) |
---|
47 | { |
---|
48 | conf_update_param('persoFooter', $_POST['perso_footer']); |
---|
49 | $template->assign( |
---|
50 | 'gestA', |
---|
51 | array('PFTBASE' => stripslashes($_POST['perso_footer']),)); |
---|
52 | array_push($page['infos'], l10n('Configuration update')); |
---|
53 | } |
---|
54 | break; |
---|
55 | case 'help': |
---|
56 | $template->assign( |
---|
57 | 'gestB', |
---|
58 | array('meta'=>l10n('nul'),)); |
---|
59 | |
---|
60 | break; |
---|
61 | } |
---|
62 | |
---|
63 | $template->set_filenames(array('plugin_admin_content' => dirname(__FILE__) . '/admin.tpl')); |
---|
64 | $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content'); |
---|
65 | } |
---|
66 | ?> |
---|