source: extensions/PersoAbout/admin/admin.php @ 13484

Last change on this file since 13484 was 9851, checked in by ddtddt, 14 years ago

[extensions] - PersoAbout - correct bug thanks to P@t

  • Property svn:eol-style set to LF
  • Property svn:keywords set to Author Date Id Revision
File size: 2.0 KB
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', 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// +-----------------------------------------------------------------------+
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('ppa_tab_gest'),
24               $my_base_url.'&amp;tab=gest');
25$tabsheet->add('help',
26               l10n('ppa_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//charge Perso About
37$query = '
38select param,value
39        FROM ' . CONFIG_TABLE . '
40  WHERE param = "persoAbout"
41        ;';
42$result = pwg_query($query);
43
44$row = mysql_fetch_array($result);
45   
46  $template->assign(
47    'gestA',
48    array(
49      'PPABASE' => $row['value'],
50      ));
51
52
53//insértion de meta dans la table
54if (isset($_POST['submitppa']) and !is_adviser())
55        {
56        $query = '
57UPDATE ' . CONFIG_TABLE . '
58  SET value= \''.$_POST['perso_about'].'\'
59  WHERE param = "persoAbout"
60    ;';
61$result = pwg_query($query);
62
63  $template->assign(
64    'gestA',
65    array(
66      'PPABASE' => stripslashes($_POST['perso_about']),
67      ));
68
69        }
70
71    break;
72
73// Tab help
74  case 'help':
75$template->assign(
76    'gestB',
77        array(
78          'meta'=>l10n('meta_name'),
79          ));
80        break;
81       
82} 
83
84$template->set_filenames(array('plugin_admin_content' => dirname(__FILE__) . '/admin.tpl')); 
85$template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
86?>
Note: See TracBrowser for help on using the repository browser.