summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCraig Andrews <candrews@integralblue.com>2009-12-04 19:51:44 -0500
committerCraig Andrews <candrews@integralblue.com>2009-12-04 19:51:44 -0500
commit7ddf911f5d54ba4997b3d237ae7cd1effb74a120 (patch)
tree0aad07732c991cd338e9530a9dccbfb670f9dd5b
parent847013db692303cde10f5f161d9fedd787421a37 (diff)
Add 2 new events: StartInlineScriptElement and EndInlineScriptElement
-rw-r--r--EVENTS.txt10
-rw-r--r--lib/htmloutputter.php19
2 files changed, 21 insertions, 8 deletions
diff --git a/EVENTS.txt b/EVENTS.txt
index f4ec62033..678df8b0a 100644
--- a/EVENTS.txt
+++ b/EVENTS.txt
@@ -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
diff --git a/lib/htmloutputter.php b/lib/htmloutputter.php
index 539e356e8..0c2d18da3 100644
--- a/lib/htmloutputter.php
+++ b/lib/htmloutputter.php
@@ -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
- }
- $this->raw($code);
- if($type == 'text/javascript') {
- $this->raw(' /*]]>*/'); // 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->elementEnd('script');
}
/**