[32193] | 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 | */ |
---|
| 10 | // +-----------------------------------------------------------------------+ |
---|
| 11 | // | Add JQuery plugin for Piwigo by TEMMII | |
---|
| 12 | // +-----------------------------------------------------------------------+ |
---|
| 13 | // | Copyright(C) 2007 - 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('AJQF_DIR' , basename(dirname(__FILE__))); |
---|
| 33 | define('AJQF_PATH' , PHPWG_PLUGINS_PATH . AJQF_DIR . '/'); |
---|
| 34 | define('AJQF_ADMIN',get_root_url().'admin.php?page=plugin-'.AJQF_DIR); |
---|
| 35 | |
---|
| 36 | add_event_handler('loading_lang', 'addjquery_loading_lang'); |
---|
| 37 | function addjquery_loading_lang(){ |
---|
| 38 | load_language('plugin.lang', AJQF_PATH); |
---|
| 39 | } |
---|
| 40 | |
---|
| 41 | add_event_handler('get_admin_plugin_menu_links', 'AJQF_admin_menu'); |
---|
| 42 | function AJQF_admin_menu($menu){ |
---|
| 43 | if (is_webmaster()){ |
---|
| 44 | array_push($menu, array( |
---|
| 45 | 'NAME' => l10n('Add jQuery'), |
---|
| 46 | 'URL' => AJQF_ADMIN)); |
---|
| 47 | } |
---|
| 48 | return $menu; |
---|
| 49 | } |
---|
| 50 | |
---|
| 51 | add_event_handler('loc_end_page_tail', 'ajqf'); |
---|
| 52 | function ajqf(){ |
---|
| 53 | global $page, $template, $conf; |
---|
| 54 | $template->assign('PLUGAJQ', $conf['PLUGAJQ']); |
---|
| 55 | $template->set_filename('PLUGAJQ', realpath(AJQF_PATH.'jquery.tpl')); |
---|
| 56 | $template->append('footer_elements', $template->parse('PLUGAJQ', true)); |
---|
| 57 | } |
---|
| 58 | ?> |
---|