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', PPA_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 | if (!is_webmaster()) |
---|
15 | { |
---|
16 | array_push($page['errors'], l10n('This section is reserved for the webmaster')); |
---|
17 | } |
---|
18 | else |
---|
19 | { |
---|
20 | |
---|
21 | // Gestion des onglets |
---|
22 | if (!isset($_GET['tab'])) |
---|
23 | $page['tab'] = 'gest'; |
---|
24 | else |
---|
25 | $page['tab'] = $_GET['tab']; |
---|
26 | |
---|
27 | $tabsheet = new tabsheet(); |
---|
28 | $tabsheet->add('gest', |
---|
29 | l10n('ppa_tab_gest'), |
---|
30 | $my_base_url.'&tab=gest'); |
---|
31 | $tabsheet->add('help', |
---|
32 | l10n('ppa_tab_help'), |
---|
33 | $my_base_url.'&tab=help'); |
---|
34 | $tabsheet->select($page['tab']); |
---|
35 | $tabsheet->assign(); |
---|
36 | |
---|
37 | // Onglet gest |
---|
38 | switch ($page['tab']) |
---|
39 | { |
---|
40 | case 'gest': |
---|
41 | |
---|
42 | $template->assign( |
---|
43 | 'gestA', |
---|
44 | array('PPABASE' => $conf['persoAbout'],)); |
---|
45 | |
---|
46 | if (isset($_POST['submitppa'])) |
---|
47 | { |
---|
48 | conf_update_param('persoAbout', $_POST['perso_about']); |
---|
49 | |
---|
50 | $template->assign( |
---|
51 | 'gestA', |
---|
52 | array('PPABASE' => stripslashes($_POST['perso_about']),)); |
---|
53 | } |
---|
54 | break; |
---|
55 | |
---|
56 | // Tab help |
---|
57 | case 'help': |
---|
58 | $template->assign( |
---|
59 | 'gestB', |
---|
60 | array('meta'=>l10n('null'),)); |
---|
61 | break; |
---|
62 | |
---|
63 | } |
---|
64 | |
---|
65 | $template->set_filenames(array('plugin_admin_content' => dirname(__FILE__) . '/admin.tpl')); |
---|
66 | $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content'); |
---|
67 | } |
---|
68 | ?> |
---|