[31458] | 1 | <?php |
---|
| 2 | // +-----------------------------------------------------------------------+ |
---|
| 3 | // | Perso Footer plugin for piwigo | |
---|
| 4 | // +-----------------------------------------------------------------------+ |
---|
| 5 | // | Copyright(C) 2011 - 2016 ddtddt http://temmii.com/piwigo/ | |
---|
| 6 | // +-----------------------------------------------------------------------+ |
---|
| 7 | // | This program is free software; you can redistribute it and/or modify | |
---|
| 8 | // | it under the terms of the GNU General Public License as published by | |
---|
| 9 | // | the Free Software Foundation | |
---|
| 10 | // | | |
---|
| 11 | // | This program is distributed in the hope that it will be useful, but | |
---|
| 12 | // | WITHOUT ANY WARRANTY; without even the implied warranty of | |
---|
| 13 | // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
---|
| 14 | // | General Public License for more details. | |
---|
| 15 | // | | |
---|
| 16 | // | You should have received a copy of the GNU General Public License | |
---|
| 17 | // | along with this program; if not, write to the Free Software | |
---|
| 18 | // | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, | |
---|
| 19 | // | USA. | |
---|
| 20 | // +-----------------------------------------------------------------------+ |
---|
| 21 | |
---|
| 22 | if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); |
---|
| 23 | global $template, $conf, $user; |
---|
| 24 | include_once(PHPWG_ROOT_PATH .'admin/include/tabsheet.class.php'); |
---|
| 25 | load_language('plugin.lang', PFT_PATH); |
---|
| 26 | $my_base_url = PHPWG_ROOT_PATH.'admin.php?page=plugin-'; |
---|
| 27 | |
---|
| 28 | // +-----------------------------------------------------------------------+ |
---|
| 29 | // | Check Access and exit when user status is not ok | |
---|
| 30 | // +-----------------------------------------------------------------------+ |
---|
| 31 | check_status(ACCESS_ADMINISTRATOR); |
---|
| 32 | |
---|
| 33 | //-------------------------------------------------------- sections definitions |
---|
| 34 | |
---|
| 35 | if (!is_webmaster()) |
---|
| 36 | { |
---|
| 37 | array_push($page['errors'], l10n('This section is reserved for the webmaster')); |
---|
| 38 | } |
---|
| 39 | else |
---|
| 40 | { |
---|
| 41 | |
---|
| 42 | // Gestion des onglets |
---|
| 43 | if (!isset($_GET['tab'])) |
---|
| 44 | $page['tab'] = 'gest'; |
---|
| 45 | else |
---|
| 46 | $page['tab'] = $_GET['tab']; |
---|
| 47 | |
---|
| 48 | $tabsheet = new tabsheet(); |
---|
| 49 | $tabsheet->add('gest', l10n('pft_tab_gest'), PFT_ADMIN . '-gest'); |
---|
| 50 | $tabsheet->add('help', l10n('pft_tab_help'), PFT_ADMIN . '-help'); |
---|
| 51 | $tabsheet->select($page['tab']); |
---|
| 52 | $tabsheet->assign(); |
---|
| 53 | |
---|
| 54 | // Onglet gest |
---|
| 55 | switch ($page['tab']){ |
---|
| 56 | case 'gest': |
---|
| 57 | |
---|
| 58 | $template->assign('gestA',array('PFTBASE' => $conf['persoFooter'],)); |
---|
| 59 | $PAED = pwg_db_fetch_assoc(pwg_query("SELECT state FROM " . PLUGINS_TABLE . " WHERE id = 'ExtendedDescription';")); |
---|
| 60 | if($PAED['state'] == 'active'){ |
---|
| 61 | $template->assign('useED',1); |
---|
| 62 | }else{ |
---|
| 63 | $template->assign('useED',0); |
---|
| 64 | } |
---|
| 65 | |
---|
| 66 | if (isset($_POST['submitpft'])) |
---|
| 67 | { |
---|
| 68 | conf_update_param('persoFooter', $_POST['perso_footer']); |
---|
| 69 | $template->assign( |
---|
| 70 | 'gestA', |
---|
| 71 | array('PFTBASE' => stripslashes($_POST['perso_footer']),)); |
---|
| 72 | array_push($page['infos'], l10n('Configuration update')); |
---|
| 73 | } |
---|
| 74 | break; |
---|
| 75 | case 'help': |
---|
| 76 | $template->assign( |
---|
| 77 | 'gestB', |
---|
| 78 | array('meta'=>l10n('nul'),)); |
---|
| 79 | |
---|
| 80 | break; |
---|
| 81 | } |
---|
| 82 | |
---|
| 83 | $template->set_filenames(array('plugin_admin_content' => dirname(__FILE__) . '/admin.tpl')); |
---|
| 84 | $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content'); |
---|
| 85 | } |
---|
| 86 | ?> |
---|