source: extensions/addjquery/main.inc.php @ 32224

Last change on this file since 32224 was 32193, checked in by ddtddt, 4 years ago

[addjquery] first release

File size: 2.5 KB
Line 
1<?php
2/*
3Plugin Name: Add JQuery in footer
4Version: auto
5Description: Add JQuery in footer
6Plugin URI: https://piwigo.org/ext/extension_view.php?eid=897
7Author: ddtddt
8Author 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
30if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
31
32define('AJQF_DIR' , basename(dirname(__FILE__)));
33define('AJQF_PATH' , PHPWG_PLUGINS_PATH . AJQF_DIR . '/');
34define('AJQF_ADMIN',get_root_url().'admin.php?page=plugin-'.AJQF_DIR);
35
36add_event_handler('loading_lang', 'addjquery_loading_lang');     
37function addjquery_loading_lang(){
38  load_language('plugin.lang', AJQF_PATH);
39}
40
41add_event_handler('get_admin_plugin_menu_links', 'AJQF_admin_menu');
42function 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
51add_event_handler('loc_end_page_tail', 'ajqf');
52function ajqf(){
53global $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?>
Note: See TracBrowser for help on using the repository browser.