]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Add 2 new events: StartInlineScriptElement and EndInlineScriptElement
authorCraig Andrews <candrews@integralblue.com>
Sat, 5 Dec 2009 00:51:44 +0000 (19:51 -0500)
committerCraig Andrews <candrews@integralblue.com>
Sat, 5 Dec 2009 00:51:44 +0000 (19:51 -0500)
EVENTS.txt
lib/htmloutputter.php

index f4ec620338c7be2d1a642231aad90b443a58f7e9..678df8b0ae378b051bbf79747a3257ae237b3343 100644 (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
index 539e356e82fa5ccea9ecf81a05485aecb0c31dc2..0c2d18da3207e77d194d26a99065fd104ab8864e 100644 (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
-        }
-        $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');
     }
 
     /**