1 | <?php |
---|
2 | /* |
---|
3 | Plugin Name: Perso Footer |
---|
4 | Version: auto |
---|
5 | Description: Add information in the footer |
---|
6 | Plugin URI: http://piwigo.org/ext/extension_view.php?eid=554 |
---|
7 | Author: ddtddt |
---|
8 | Author 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 | |
---|
30 | if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); |
---|
31 | |
---|
32 | define('PFT_DIR' , basename(dirname(__FILE__))); |
---|
33 | define('PFT_PATH' , PHPWG_PLUGINS_PATH . PFT_DIR . '/'); |
---|
34 | define('PFT_ADMIN',get_root_url().'admin.php?page=plugin-'.PFT_DIR); |
---|
35 | |
---|
36 | add_event_handler('get_admin_plugin_menu_links', 'PFT_admin_menu'); |
---|
37 | function 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 | |
---|
46 | add_event_handler('loc_end_page_tail', 'pft'); |
---|
47 | function pft(){ |
---|
48 | global $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 | ?> |
---|