Last change
on this file since 16824 was
14969,
checked in by ddtddt, 12 years ago
|
[extensions] - add_head_element - clean code
|
File size:
896 bytes
|
Line | |
---|
1 | <?php |
---|
2 | /* |
---|
3 | Plugin Name: Plugin add < head > element |
---|
4 | Version: auto |
---|
5 | Description: Add element to tag < head > |
---|
6 | Plugin URI: http://piwigo.org/ext/extension_view.php?eid=582 |
---|
7 | Author: ddtddt |
---|
8 | Author URI: http://piwigo.org/ |
---|
9 | */ |
---|
10 | |
---|
11 | if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); |
---|
12 | |
---|
13 | global $prefixeTable; |
---|
14 | |
---|
15 | define('AHE_DIR' , basename(dirname(__FILE__))); |
---|
16 | define('AHE_PATH' , PHPWG_PLUGINS_PATH . AHE_DIR . '/'); |
---|
17 | |
---|
18 | add_event_handler('get_admin_plugin_menu_links', 'AHE_admin_menu'); |
---|
19 | function AHE_admin_menu($menu) |
---|
20 | { |
---|
21 | array_push($menu, array( |
---|
22 | 'NAME' => 'Add < head > element', |
---|
23 | 'URL' => get_admin_plugin_menu_link(AHE_PATH . 'admin/admin.php'))); |
---|
24 | return $menu; |
---|
25 | } |
---|
26 | |
---|
27 | |
---|
28 | //add in <head> |
---|
29 | add_event_handler('loc_begin_page_header', 'AHE1',20 ); |
---|
30 | |
---|
31 | function AHE1() |
---|
32 | { |
---|
33 | |
---|
34 | global $template,$conf; |
---|
35 | |
---|
36 | if (!empty($conf['add_head_element'])) |
---|
37 | { |
---|
38 | $template->append('head_elements', $conf['add_head_element']); |
---|
39 | } |
---|
40 | } |
---|
41 | ?> |
---|
Note: See
TracBrowser
for help on using the repository browser.