source: extensions/PersoFooter/main.inc.php @ 32179

Last change on this file since 32179 was 32179, checked in by ddtddt, 5 years ago

[PersoFooter]

File size: 2.7 KB
Line 
1<?php
2/*
3Plugin Name: Perso Footer
4Version: auto
5Description: Add information in the footer
6Plugin URI: http://piwigo.org/ext/extension_view.php?eid=554
7Author: ddtddt
8Author URI: http://temmii.com/piwigo/
9*/
10// +-----------------------------------------------------------------------+
11// | Perso Footer plugin for Piwigo by TEMMII                              |
12// +-----------------------------------------------------------------------+
13// | Copyright(C) 2011 - 2020 ddtddt             http://temmii.com/piwigo/ |
14// +-----------------------------------------------------------------------+
15// | This program is free software; you can redistribute it and/or modify  |
16// | it under the terms of the GNU General Public License as published by  |
17// | the Free Software Foundation                                          |
18// |                                                                       |
19// | This program is distributed in the hope that it will be useful, but   |
20// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
21// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
22// | General Public License for more details.                              |
23// |                                                                       |
24// | You should have received a copy of the GNU General Public License     |
25// | along with this program; if not, write to the Free Software           |
26// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
27// | USA.                                                                  |
28// +-----------------------------------------------------------------------+
29
30if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
31
32define('PFT_DIR' , basename(dirname(__FILE__)));
33define('PFT_PATH' , PHPWG_PLUGINS_PATH . PFT_DIR . '/');
34define('PFT_ADMIN',get_root_url().'admin.php?page=plugin-'.PFT_DIR);
35
36add_event_handler('get_admin_plugin_menu_links', 'PFT_admin_menu');
37function PFT_admin_menu($menu){
38  if (is_webmaster()){
39        array_push($menu, array(
40          'NAME' => 'Perso Footer',
41          'URL' => PFT_ADMIN));
42  } 
43  return $menu;
44}
45
46add_event_handler('loc_end_page_tail', 'pft');
47function pft(){
48global $page, $pwg_loaded_plugins;
49  if ((script_basename() != 'admin') and ($page['body_id'] != 'thePopuphelpPage')){
50        global $template, $conf;
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        }
56        $template->set_filename('PERSO_FOOTER', realpath(PFT_PATH.'persofooter.tpl')); 
57        $template->append('footer_elements', $template->parse('PERSO_FOOTER', true));
58  }
59}
60?>
Note: See TracBrowser for help on using the repository browser.