source: extensions/PersoFooter/admin/admin.php @ 24492

Revision 24492, 1.8 KB checked in by ddtddt, 7 years ago (diff)

[extensions] PersoFooter - add message update and access only webmaster

Line 
1<?php
2if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
3global $template, $conf, $user;
4include_once(PHPWG_ROOT_PATH .'admin/include/tabsheet.class.php');
5load_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// +-----------------------------------------------------------------------+
11check_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
23if (!isset($_GET['tab']))
24    $page['tab'] = 'gest';
25else
26    $page['tab'] = $_GET['tab'];
27
28$tabsheet = new tabsheet();
29$tabsheet->add('gest',
30               l10n('pft_tab_gest'),
31               $my_base_url.'&amp;tab=gest');
32$tabsheet->add('help',
33               l10n('pft_tab_help'),
34               $my_base_url.'&amp;tab=help');
35$tabsheet->select($page['tab']);
36$tabsheet->assign();
37
38// Onglet gest
39switch ($page['tab'])
40{
41  case 'gest':
42   
43  $template->assign('gestA',
44    array('PFTBASE' => $conf['persoFooter'],));
45
46if (isset($_POST['submitpft']))
47        {
48conf_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?>
Note: See TracBrowser for help on using the repository browser.