1 | <?php |
---|
2 | /* |
---|
3 | Plugin Name: Add JQuery in footer |
---|
4 | Version: auto |
---|
5 | Description: Add JQuery in footer |
---|
6 | Plugin URI: https://piwigo.org/ext/extension_view.php?eid=897 |
---|
7 | Author: ddtddt |
---|
8 | Author URI: http://temmii.com/piwigo/ |
---|
9 | Has Settings: webmaster |
---|
10 | */ |
---|
11 | // +-----------------------------------------------------------------------+ |
---|
12 | // | Add JQuery plugin for Piwigo by TEMMII | |
---|
13 | // +-----------------------------------------------------------------------+ |
---|
14 | // | Copyright(C) 2020 - 2021 ddtddt http://temmii.com/piwigo/ | |
---|
15 | // +-----------------------------------------------------------------------+ |
---|
16 | // | This program is free software; you can redistribute it and/or modify | |
---|
17 | // | it under the terms of the GNU General Public License as published by | |
---|
18 | // | the Free Software Foundation | |
---|
19 | // | | |
---|
20 | // | This program is distributed in the hope that it will be useful, but | |
---|
21 | // | WITHOUT ANY WARRANTY; without even the implied warranty of | |
---|
22 | // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
---|
23 | // | General Public License for more details. | |
---|
24 | // | | |
---|
25 | // | You should have received a copy of the GNU General Public License | |
---|
26 | // | along with this program; if not, write to the Free Software | |
---|
27 | // | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, | |
---|
28 | // | USA. | |
---|
29 | // +-----------------------------------------------------------------------+ |
---|
30 | |
---|
31 | if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); |
---|
32 | |
---|
33 | define('AJQF_DIR' , basename(dirname(__FILE__))); |
---|
34 | define('AJQF_PATH' , PHPWG_PLUGINS_PATH . AJQF_DIR . '/'); |
---|
35 | define('AJQF_ADMIN',get_root_url().'admin.php?page=plugin-'.AJQF_DIR); |
---|
36 | |
---|
37 | add_event_handler('loading_lang', 'addjquery_loading_lang'); |
---|
38 | function addjquery_loading_lang(){ |
---|
39 | load_language('plugin.lang', AJQF_PATH); |
---|
40 | } |
---|
41 | /* |
---|
42 | add_event_handler('get_admin_plugin_menu_links', 'AJQF_admin_menu'); |
---|
43 | function AJQF_admin_menu($menu){ |
---|
44 | if (is_webmaster()){ |
---|
45 | array_push($menu, array( |
---|
46 | 'NAME' => l10n('Add jQuery'), |
---|
47 | 'URL' => AJQF_ADMIN)); |
---|
48 | } |
---|
49 | return $menu; |
---|
50 | } |
---|
51 | */ |
---|
52 | add_event_handler('loc_end_page_tail', 'ajqf'); |
---|
53 | function ajqf(){ |
---|
54 | global $page, $template, $conf; |
---|
55 | $template->assign('PLUGAJQ', $conf['PLUGAJQ']); |
---|
56 | $template->set_filename('PLUGAJQ', realpath(AJQF_PATH.'jquery.tpl')); |
---|
57 | $template->append('footer_elements', $template->parse('PLUGAJQ', true)); |
---|
58 | } |
---|
59 | ?> |
---|