source: extensions/PersoFooter/admin.php @ 33105

Last change on this file since 33105 was 32904, checked in by ddtddt, 21 months ago

[PersoFooter] compatybilité php8

File size: 3.3 KB
RevLine 
[31458]1<?php
2// +-----------------------------------------------------------------------+
[32179]3// | Perso Footer plugin for Piwigo by TEMMII                              |
[31458]4// +-----------------------------------------------------------------------+
[32904]5// | Copyright(C) 2011 - 2023 ddtddt             http://temmii.com/piwigo/ |
[31458]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
22if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
23global $template, $conf, $user;
24include_once(PHPWG_ROOT_PATH .'admin/include/tabsheet.class.php');
25load_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// +-----------------------------------------------------------------------+
31check_status(ACCESS_ADMINISTRATOR);
32
33//-------------------------------------------------------- sections definitions
34
[32179]35if (!is_webmaster()){
36  $_SESSION['page_errors'] = array(l10n('This section is reserved for the webmaster'));
37}else{
[31458]38
[32179]39 // Tab manage
[31458]40if (!isset($_GET['tab']))
41    $page['tab'] = 'gest';
42else
43    $page['tab'] = $_GET['tab'];
44
45$tabsheet = new tabsheet();
46  $tabsheet->add('gest', l10n('pft_tab_gest'), PFT_ADMIN . '-gest');
47  $tabsheet->add('help', l10n('pft_tab_help'), PFT_ADMIN . '-help');
48$tabsheet->select($page['tab']);
49$tabsheet->assign();
50
[32179]51// tab gest
[31458]52switch ($page['tab']){
53  case 'gest':
[32179]54 
55  global $pwg_loaded_plugins;
[31458]56   
57  $template->assign('gestA',array('PFTBASE' => $conf['persoFooter'],));
[32179]58  if (isset($pwg_loaded_plugins['ExtendedDescription'])){
59        $template->assign('useED',1);
60  }else{
61    $template->assign('useED',0);
62  }
[31458]63
[32179]64  if (isset($_POST['submitpft'])){
65    conf_update_param('persoFooter', $_POST['perso_footer']);
66    $template->assign(
67      'gestA',
68        array('PFTBASE' => stripslashes($_POST['perso_footer']),));
69                $_SESSION['page_infos'] = array(l10n('Configuration update'));
70  }
[31458]71  break;
[32179]72 
[31458]73  case 'help':
[32179]74  $template->assign(
[31458]75    'gestB',
[32179]76          array('meta'=>l10n('nul'),));
[31458]77       
78  break;
79}
80
81$template->set_filenames(array('plugin_admin_content' => dirname(__FILE__) . '/admin.tpl')); 
82$template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
83}
84?>
Note: See TracBrowser for help on using the repository browser.