source: extensions/add_head_element/main.inc.php @ 13278

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/*
3Plugin Name: Plugin add < head > element
4Version: auto
5Description: Add element to tag < head >
6Plugin URI: http://piwigo.org/ext/extension_view.php?eid=582
7Author: ddtddt
8Author URI: http://piwigo.org/
9*/
10
11if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
12
13global $prefixeTable;
14
15define('AHE_DIR' , basename(dirname(__FILE__)));
16define('AHE_PATH' , PHPWG_PLUGINS_PATH . AHE_DIR . '/');
17
18add_event_handler('get_admin_plugin_menu_links', 'AHE_admin_menu');
19function 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>
29add_event_handler('loc_begin_page_header', 'AHE1',20 );
30
31function AHE1()
32{
33
34global $template;
35
36$query = '
37select 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.