[8115] | 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 | |
---|
| 15 | // Gestion des onglets |
---|
| 16 | if (!isset($_GET['tab'])) |
---|
| 17 | $page['tab'] = 'gest'; |
---|
| 18 | else |
---|
| 19 | $page['tab'] = $_GET['tab']; |
---|
| 20 | |
---|
| 21 | $tabsheet = new tabsheet(); |
---|
| 22 | $tabsheet->add('gest', |
---|
| 23 | l10n('ppa_tab_gest'), |
---|
| 24 | $my_base_url.'&tab=gest'); |
---|
| 25 | $tabsheet->add('help', |
---|
| 26 | l10n('ppa_tab_help'), |
---|
| 27 | $my_base_url.'&tab=help'); |
---|
| 28 | $tabsheet->select($page['tab']); |
---|
| 29 | $tabsheet->assign(); |
---|
| 30 | |
---|
| 31 | // Onglet gest |
---|
| 32 | switch ($page['tab']) |
---|
| 33 | { |
---|
| 34 | case 'gest': |
---|
| 35 | |
---|
| 36 | //charge Perso About |
---|
| 37 | $query = ' |
---|
| 38 | select 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 |
---|
| 54 | if (isset($_POST['submitppa']) and !is_adviser()) |
---|
| 55 | { |
---|
| 56 | $query = ' |
---|
| 57 | UPDATE ' . 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( |
---|
[9851] | 66 | 'PPABASE' => stripslashes($_POST['perso_about']), |
---|
[8115] | 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 | ?> |
---|