summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--EVENTS.txt6
-rw-r--r--lib/action.php19
2 files changed, 17 insertions, 8 deletions
diff --git a/EVENTS.txt b/EVENTS.txt
index 68cb28603..dfaf34a66 100644
--- a/EVENTS.txt
+++ b/EVENTS.txt
@@ -134,3 +134,9 @@ StartAddressData: Allows the site owner to provide additional information about
EndAddressData: At the end of <address>
- $action: the current action
+
+StartShowHeadElements: Right after the <head> tag
+- $action: the current action
+
+EndShowHeadElements: Right before the </head> tag; put <script>s here if you need them in <head>
+- $action: the current action
diff --git a/lib/action.php b/lib/action.php
index 670eb498c..ebc812aca 100644
--- a/lib/action.php
+++ b/lib/action.php
@@ -120,14 +120,16 @@ class Action extends HTMLOutputter // lawsuit
{
// XXX: attributes (profile?)
$this->elementStart('head');
- $this->showTitle();
- $this->showShortcutIcon();
- $this->showStylesheets();
- $this->showScripts();
- $this->showOpenSearch();
- $this->showFeeds();
- $this->showDescription();
- $this->extraHead();
+ if (Event::handle('StartShowHeadElements', array($this))) {
+ $this->showTitle();
+ $this->showShortcutIcon();
+ $this->showStylesheets();
+ $this->showOpenSearch();
+ $this->showFeeds();
+ $this->showDescription();
+ $this->extraHead();
+ Event::handle('EndShowHeadElements', array($this));
+ }
$this->elementEnd('head');
}
@@ -352,6 +354,7 @@ class Action extends HTMLOutputter // lawsuit
Event::handle('EndShowFooter', array($this));
}
$this->elementEnd('div');
+ $this->showScripts();
$this->elementEnd('body');
}