move scripts to just before </body>, add event for scripts that need to be in <head>

This commit is contained in:
Evan Prodromou 2009-09-23 23:23:13 -04:00
parent 543e3e7972
commit a5ed805aea
2 changed files with 17 additions and 8 deletions

View File

@ -134,3 +134,9 @@ StartAddressData: Allows the site owner to provide additional information about
EndAddressData: At the end of <address> EndAddressData: At the end of <address>
- $action: the current action - $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

View File

@ -120,14 +120,16 @@ class Action extends HTMLOutputter // lawsuit
{ {
// XXX: attributes (profile?) // XXX: attributes (profile?)
$this->elementStart('head'); $this->elementStart('head');
$this->showTitle(); if (Event::handle('StartShowHeadElements', array($this))) {
$this->showShortcutIcon(); $this->showTitle();
$this->showStylesheets(); $this->showShortcutIcon();
$this->showScripts(); $this->showStylesheets();
$this->showOpenSearch(); $this->showOpenSearch();
$this->showFeeds(); $this->showFeeds();
$this->showDescription(); $this->showDescription();
$this->extraHead(); $this->extraHead();
Event::handle('EndShowHeadElements', array($this));
}
$this->elementEnd('head'); $this->elementEnd('head');
} }
@ -352,6 +354,7 @@ class Action extends HTMLOutputter // lawsuit
Event::handle('EndShowFooter', array($this)); Event::handle('EndShowFooter', array($this));
} }
$this->elementEnd('div'); $this->elementEnd('div');
$this->showScripts();
$this->elementEnd('body'); $this->elementEnd('body');
} }