Add 2 new events: StartInlineScriptElement and EndInlineScriptElement

This commit is contained in:
Craig Andrews 2009-12-04 19:51:44 -05:00
parent 847013db69
commit 7ddf911f5d
2 changed files with 21 additions and 8 deletions

View File

@ -595,3 +595,13 @@ EndScriptElement: After a <script...> element is written
- $action
- $src
- $type
StartInlineScriptElement: Before a <script...> element is written
- $action
- &$code
- &$type
EndInlineScriptElement: After a <script...> element is written
- $action
- $code
- $type

View File

@ -375,15 +375,18 @@ class HTMLOutputter extends XMLOutputter
function inlineScript($code, $type='text/javascript')
{
$this->elementStart('script', array('type' => $type));
if($type == 'text/javascript') {
$this->raw('/*<![CDATA[*/ '); // XHTML compat
if(Event::handle('StartInlineScriptElement', array($this,&$code,&$type))) {
$this->elementStart('script', array('type' => $type));
if($type == 'text/javascript') {
$this->raw('/*<![CDATA[*/ '); // XHTML compat
}
$this->raw($code);
if($type == 'text/javascript') {
$this->raw(' /*]]>*/'); // XHTML compat
}
$this->elementEnd('script');
Event::handle('EndInlineScriptElement', array($this,$code,$type));
}
$this->raw($code);
if($type == 'text/javascript') {
$this->raw(' /*]]>*/'); // XHTML compat
}
$this->elementEnd('script');
}
/**