Permalink
Browse files

Add plugin hook 'head'.

Allows to add tags in <head /> from plugins
  • Loading branch information...
1 parent 632e9a1 commit 12af0f7cb55a7e7d41aaff18977e472f76972483 @ioguix ioguix committed Mar 25, 2013
Showing with 12 additions and 1 deletion.
  1. +11 −1 classes/Misc.php
  2. +1 −0 classes/PluginManager.php
View
@@ -520,7 +520,7 @@ function getDatabaseAccessor($database, $server_id = null) {
* @param $script script tag
*/
function printHeader($title = '', $script = null, $frameset = false) {
- global $appName, $lang, $_no_output, $conf;
+ global $appName, $lang, $_no_output, $conf, $plugin_manager;
if (!isset($_no_output)) {
header("Content-Type: text/html; charset=utf-8");
@@ -549,6 +549,16 @@ function printHeader($title = '', $script = null, $frameset = false) {
echo "</title>\n";
if ($script) echo "{$script}\n";
+
+ $plugins_head = array();
+ $_params = array('heads' => &$plugins_head);
+
+ $plugin_manager->do_hook('head', $_params);
+
+ foreach($plugins_head as $tag) {
+ echo $tag;
+ }
+
echo "</head>\n";
}
}
@@ -11,6 +11,7 @@ class PluginManager {
*/
private $plugins_list = array();
private $available_hooks = array(
+ 'head',
'toplinks',
'tabs',
'trail',

0 comments on commit 12af0f7

Please sign in to comment.