Changeset 32179


Ignore:
Timestamp:
May 5, 2020, 1:29:47 PM (4 years ago)
Author:
ddtddt
Message:

[PersoFooter]

Location:
extensions/PersoFooter
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • extensions/PersoFooter/admin.php

    r31458 r32179  
    11<?php
    22// +-----------------------------------------------------------------------+
    3 // | Perso Footer plugin for piwigo                                        |
     3// | Perso Footer plugin for Piwigo by TEMMII                              |
    44// +-----------------------------------------------------------------------+
    5 // | Copyright(C) 2011 - 2016 ddtddt             http://temmii.com/piwigo/ |
     5// | Copyright(C) 2011 - 2020 ddtddt             http://temmii.com/piwigo/ |
    66// +-----------------------------------------------------------------------+
    77// | This program is free software; you can redistribute it and/or modify  |
     
    3333//-------------------------------------------------------- sections definitions
    3434
    35           if (!is_webmaster())
    36   {
    37     array_push($page['errors'], l10n('This section is reserved for the webmaster'));
    38   }
    39   else
    40   {
     35if (!is_webmaster()){
     36  $_SESSION['page_errors'] = array(l10n('This section is reserved for the webmaster'));
     37}else{
    4138
    42 // Gestion des onglets
     39 // Tab manage
    4340if (!isset($_GET['tab']))
    4441    $page['tab'] = 'gest';
     
    5249$tabsheet->assign();
    5350
    54 // Onglet gest
     51// tab gest
    5552switch ($page['tab']){
    5653  case 'gest':
     54 
     55  global $pwg_loaded_plugins;
    5756   
    5857  $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     }
     58  if (isset($pwg_loaded_plugins['ExtendedDescription'])){
     59        $template->assign('useED',1);
     60  }else{
     61    $template->assign('useED',0);
     62  }
    6563
    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         }
     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  }
    7471  break;
     72 
    7573  case 'help':
    76 $template->assign(
     74  $template->assign(
    7775    'gestB',
    78         array('meta'=>l10n('nul'),));
     76          array('meta'=>l10n('nul'),));
    7977       
    8078  break;
  • extensions/PersoFooter/index.php

    r31458 r32179  
    11<?php
     2// +-----------------------------------------------------------------------+
     3// | This file is part of Piwigo.                                          |
     4// |                                                                       |
     5// | For copyright and license information, please view the COPYING.txt    |
     6// | file that was distributed with this source code.                      |
     7// +-----------------------------------------------------------------------+
     8
    29// Recursive call
    310$url = '../';
  • extensions/PersoFooter/language/en_UK/index.php

    r31458 r32179  
    11<?php
     2// +-----------------------------------------------------------------------+
     3// | This file is part of Piwigo.                                          |
     4// |                                                                       |
     5// | For copyright and license information, please view the COPYING.txt    |
     6// | file that was distributed with this source code.                      |
     7// +-----------------------------------------------------------------------+
     8
    29// Recursive call
    310$url = '../';
  • extensions/PersoFooter/language/en_UK/plugin.lang.php

    r31458 r32179  
    11<?php
    22// +-----------------------------------------------------------------------+
    3 // | Perso Footer plugin for piwigo                                        |
     3// | Perso Footer plugin for Piwigo by TEMMII                              |
    44// +-----------------------------------------------------------------------+
    5 // | Copyright(C) 2011 - 2016 ddtddt             http://temmii.com/piwigo/ |
     5// | Copyright(C) 2011 - 2020 ddtddt             http://temmii.com/piwigo/ |
    66// +-----------------------------------------------------------------------+
    77// | This program is free software; you can redistribute it and/or modify  |
  • extensions/PersoFooter/language/fr_FR/index.php

    r31458 r32179  
    11<?php
     2// +-----------------------------------------------------------------------+
     3// | This file is part of Piwigo.                                          |
     4// |                                                                       |
     5// | For copyright and license information, please view the COPYING.txt    |
     6// | file that was distributed with this source code.                      |
     7// +-----------------------------------------------------------------------+
     8
    29// Recursive call
    310$url = '../';
  • extensions/PersoFooter/language/fr_FR/plugin.lang.php

    r31458 r32179  
    11<?php
    22// +-----------------------------------------------------------------------+
    3 // | Perso Footer plugin for piwigo                                        |
     3// | Perso Footer plugin for Piwigo by TEMMII                              |
    44// +-----------------------------------------------------------------------+
    5 // | Copyright(C) 2011 - 2016 ddtddt             http://temmii.com/piwigo/ |
     5// | Copyright(C) 2011 - 2020 ddtddt             http://temmii.com/piwigo/ |
    66// +-----------------------------------------------------------------------+
    77// | This program is free software; you can redistribute it and/or modify  |
  • extensions/PersoFooter/language/index.php

    r11216 r32179  
    11<?php
    22// +-----------------------------------------------------------------------+
    3 // | Piwigo - a PHP based picture gallery                                  |
    4 // +-----------------------------------------------------------------------+
    5 // | Copyright(C) 2008-2009 Piwigo Team                  http://piwigo.org |
    6 // | Copyright(C) 2003-2008 PhpWebGallery Team    http://phpwebgallery.net |
    7 // | Copyright(C) 2002-2003 Pierrick LE GALL   http://le-gall.net/pierrick |
    8 // +-----------------------------------------------------------------------+
    9 // | This program is free software; you can redistribute it and/or modify  |
    10 // | it under the terms of the GNU General Public License as published by  |
    11 // | the Free Software Foundation                                          |
     3// | This file is part of Piwigo.                                          |
    124// |                                                                       |
    13 // | This program is distributed in the hope that it will be useful, but   |
    14 // | WITHOUT ANY WARRANTY; without even the implied warranty of            |
    15 // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
    16 // | General Public License for more details.                              |
    17 // |                                                                       |
    18 // | You should have received a copy of the GNU General Public License     |
    19 // | along with this program; if not, write to the Free Software           |
    20 // | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
    21 // | USA.                                                                  |
     5// | For copyright and license information, please view the COPYING.txt    |
     6// | file that was distributed with this source code.                      |
    227// +-----------------------------------------------------------------------+
    238
  • extensions/PersoFooter/main.inc.php

    r31458 r32179  
    99*/
    1010// +-----------------------------------------------------------------------+
    11 // | Perso Footer plugin for piwigo                                        |
     11// | Perso Footer plugin for Piwigo by TEMMII                              |
    1212// +-----------------------------------------------------------------------+
    13 // | Copyright(C) 2011 - 2016 ddtddt             http://temmii.com/piwigo/ |
     13// | Copyright(C) 2011 - 2020 ddtddt             http://temmii.com/piwigo/ |
    1414// +-----------------------------------------------------------------------+
    1515// | This program is free software; you can redistribute it and/or modify  |
     
    3535
    3636add_event_handler('get_admin_plugin_menu_links', 'PFT_admin_menu');
    37 function PFT_admin_menu($menu)
    38 {
    39   array_push($menu, array(
    40         'NAME' => 'Perso Footer',
    41     'URL' => get_admin_plugin_menu_link(PFT_PATH . 'admin.php')));
     37function PFT_admin_menu($menu){
     38  if (is_webmaster()){
     39        array_push($menu, array(
     40          'NAME' => 'Perso Footer',
     41          'URL' => PFT_ADMIN));
     42  }
    4243  return $menu;
    4344}
    4445
    4546add_event_handler('loc_end_page_tail', 'pft');
    46 function pft()
    47  {
    48         global $page;
    49    if ((script_basename() != 'admin') and ($page['body_id'] != 'thePopuphelpPage'))
    50   {
     47function pft(){
     48global $page, $pwg_loaded_plugins;
     49  if ((script_basename() != 'admin') and ($page['body_id'] != 'thePopuphelpPage')){
    5150        global $template, $conf;
    52 $PAED = pwg_db_fetch_assoc(pwg_query("SELECT state FROM " . PLUGINS_TABLE . " WHERE id = 'ExtendedDescription';"));
    53 if($PAED['state'] == 'active') add_event_handler('AP_render_content', 'get_user_language_desc');
    54 
    55 $pat=trigger_change('AP_render_content', $conf['persoFooter']);
    56                  if (!empty($pat))
    57                         {
    58                                 $template->assign('PERSO_FOOTER2', $pat);
    59                         }
    60                        
     51        if (isset($pwg_loaded_plugins['ExtendedDescription'])){add_event_handler('AP_render_content', 'get_user_language_desc');}
     52        $pat=trigger_change('AP_render_content', $conf['persoFooter']);
     53         if (!empty($pat)){
     54                 $template->assign('PERSO_FOOTER2', $pat);
     55        }
    6156        $template->set_filename('PERSO_FOOTER', realpath(PFT_PATH.'persofooter.tpl')); 
    6257        $template->append('footer_elements', $template->parse('PERSO_FOOTER', true));
    63         }
    64  }
     58  }
     59}
    6560?>
  • extensions/PersoFooter/maintain.class.php

    r31458 r32179  
    11<?php
    22// +-----------------------------------------------------------------------+
    3 // | Perso Footer plugin for piwigo                                        |
     3// | Perso Footer plugin for Piwigo by TEMMII                              |
    44// +-----------------------------------------------------------------------+
    5 // | Copyright(C) 2011 - 2016 ddtddt             http://temmii.com/piwigo/ |
     5// | Copyright(C) 2011 - 2020 ddtddt             http://temmii.com/piwigo/ |
    66// +-----------------------------------------------------------------------+
    77// | This program is free software; you can redistribute it and/or modify  |
     
    2222if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
    2323
    24 class PersoFooter_maintain extends PluginMaintain
    25 {
    26   function install($plugin_version, &$errors=array())
    27   {
    28     $query = 'INSERT INTO ' . CONFIG_TABLE . ' (param,value,comment) VALUES ("persoFooter","","html displayed on the footer page of your galler...");';
    29     pwg_query($query);
     24class PersoFooter_maintain extends PluginMaintain{
     25  function install($plugin_version, &$errors=array()){
     26    pwg_query('INSERT INTO ' . CONFIG_TABLE . ' (param,value,comment) VALUES ("persoFooter","","html displayed on the footer page of your galler...");');
    3027  }
    3128
Note: See TracChangeset for help on using the changeset viewer.