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

Last change on this file since 24492 was 24492, checked in by ddtddt, 11 years ago

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

File size: 1.8 KB
RevLine 
[11216]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
[24492]15          if (!is_webmaster())
16  {
17    array_push($page['errors'], l10n('This section is reserved for the webmaster'));
18  }
19  else
20  {
21
[11216]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':
[14972]42   
43  $template->assign('gestA',
44    array('PFTBASE' => $conf['persoFooter'],));
[11216]45
46if (isset($_POST['submitpft']))
47        {
[14972]48conf_update_param('persoFooter', $_POST['perso_footer']);
49$template->assign(
[11216]50    'gestA',
[14972]51    array('PFTBASE' => stripslashes($_POST['perso_footer']),));
[24492]52        array_push($page['infos'], l10n('Configuration update'));
[11216]53        }
[14972]54  break;
[11216]55  case 'help':
56$template->assign(
57    'gestB',
[14972]58        array('meta'=>l10n('nul'),));
[24492]59       
[14972]60  break;
[24492]61}
[11216]62
63$template->set_filenames(array('plugin_admin_content' => dirname(__FILE__) . '/admin.tpl')); 
64$template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
[24492]65}
[11216]66?>
Note: See TracBrowser for help on using the repository browser.