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

Last change on this file since 31958 was 31458, checked in by ddtddt, 8 years ago

[extensions] - PersoFooter - 2.8

File size: 2.8 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                                        |
12// +-----------------------------------------------------------------------+
13// | Copyright(C) 2011 - 2016 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{
39  array_push($menu, array(
40        'NAME' => 'Perso Footer',
41    'URL' => get_admin_plugin_menu_link(PFT_PATH . 'admin.php')));
42  return $menu;
43}
44
45add_event_handler('loc_end_page_tail', 'pft');
46function pft()
47 {
48        global $page;
49   if ((script_basename() != 'admin') and ($page['body_id'] != 'thePopuphelpPage'))
50  {
51        global $template, $conf;
52$PAED = pwg_db_fetch_assoc(pwg_query("SELECT state FROM " . PLUGINS_TABLE . " WHERE id = 'ExtendedDescription';"));
53if($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                       
61        $template->set_filename('PERSO_FOOTER', realpath(PFT_PATH.'persofooter.tpl')); 
62        $template->append('footer_elements', $template->parse('PERSO_FOOTER', true));
63        }
64 }
65?>
Note: See TracBrowser for help on using the repository browser.