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