summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJehan-Guillaume (ioguix) de Rorthais2013-03-25 15:37:06 +0000
committerRobert Treat2013-03-26 17:57:11 +0000
commit3f212d646ee7c94efbd2b6b7b7d18450d531e33d (patch)
treeb649733498439aa3e62b5465704e722913b96ba3
parent202be379e6e7cf7ad217d945d367fff448cb7256 (diff)
Add plugin hook 'head'.
Allows to add tags in <head /> from plugins
-rw-r--r--classes/Misc.php12
-rw-r--r--classes/PluginManager.php1
2 files changed, 12 insertions, 1 deletions
diff --git a/classes/Misc.php b/classes/Misc.php
index 0457b4d8..cd22df8b 100644
--- a/classes/Misc.php
+++ b/classes/Misc.php
@@ -520,7 +520,7 @@
* @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 @@
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";
}
}
diff --git a/classes/PluginManager.php b/classes/PluginManager.php
index 3bc1eb39..9634b412 100644
--- a/classes/PluginManager.php
+++ b/classes/PluginManager.php
@@ -11,6 +11,7 @@ class PluginManager {
*/
private $plugins_list = array();
private $available_hooks = array(
+ 'head',
'toplinks',
'tabs',
'trail',