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

Revision 14972, 1.6 KB checked in by ddtddt, 8 years ago (diff)

[extensions] - PersoFooter - clean code

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// Gestion des onglets
16if (!isset($_GET['tab']))
17    $page['tab'] = 'gest';
18else
19    $page['tab'] = $_GET['tab'];
20
21$tabsheet = new tabsheet();
22$tabsheet->add('gest',
23               l10n('pft_tab_gest'),
24               $my_base_url.'&amp;tab=gest');
25$tabsheet->add('help',
26               l10n('pft_tab_help'),
27               $my_base_url.'&amp;tab=help');
28$tabsheet->select($page['tab']);
29$tabsheet->assign();
30
31// Onglet gest
32switch ($page['tab'])
33{
34  case 'gest':
35   
36  $template->assign('gestA',
37    array('PFTBASE' => $conf['persoFooter'],));
38
39if (isset($_POST['submitpft']))
40        {
41conf_update_param('persoFooter', $_POST['perso_footer']);
42$template->assign(
43    'gestA',
44    array('PFTBASE' => stripslashes($_POST['perso_footer']),));
45        }
46  break;
47  case 'help':
48$template->assign(
49    'gestB',
50        array('meta'=>l10n('nul'),));
51  break;
52} 
53
54$template->set_filenames(array('plugin_admin_content' => dirname(__FILE__) . '/admin.tpl')); 
55$template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
56?>
Note: See TracBrowser for help on using the repository browser.