Last change
on this file since 13278 was
12496,
checked in by ddtddt, 13 years ago
|
[extensions] - add_head_element - first commit
|
File size:
1.0 KB
|
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; |
---|
35 | |
---|
36 | $query = ' |
---|
37 | select param,value |
---|
38 | FROM ' . CONFIG_TABLE . ' |
---|
39 | WHERE param = "add_head_element" |
---|
40 | ;'; |
---|
41 | $result = pwg_query($query); |
---|
42 | $row = mysql_fetch_assoc($result); |
---|
43 | |
---|
44 | if (!empty($row['value'])) |
---|
45 | { |
---|
46 | $template->append('head_elements', $row['value']); |
---|
47 | } |
---|
48 | } |
---|
49 | ?> |
---|
Note: See
TracBrowser
for help on using the repository browser.