]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Merge commit 'refs/merge-requests/108' of git://gitorious.org/statusnet/mainline...
authorBrion Vibber <brion@pobox.com>
Fri, 4 Dec 2009 20:23:33 +0000 (12:23 -0800)
committerBrion Vibber <brion@pobox.com>
Fri, 4 Dec 2009 20:23:33 +0000 (12:23 -0800)
1  2 
lib/htmloutputter.php

index 3fabc4037a212c2c3e7559e9e0c490316d284845,a7c596917cefc0697c64426e8efe23411bf0ea88..a0066594f24acda8c41c2aec2c974e3cdb4876d9
@@@ -350,35 -350,19 +350,38 @@@ class HTMLOutputter extends XMLOutputte
       */
      function script($src, $type='text/javascript')
      {
-         $url = parse_url($src);
-         if( empty($url->scheme) && empty($url->host) && empty($url->query) && empty($url->fragment))
-         {
-             $src = common_path($src) . '?version=' . STATUSNET_VERSION;
+         if(Event::handle('StartScriptElement', array($this,&$src,&$type))) {
+             $url = parse_url($src);
+             if( empty($url->scheme) && empty($url->host) && empty($url->query) && empty($url->fragment))
+             {
+                 $src = common_path($src) . '?version=' . STATUSNET_VERSION;
+             }
+             $this->element('script', array('type' => $type,
+                                                    'src' => $src),
+                                    ' ');
+             Event::handle('EndScriptElement', array($this,$src,$type));
          }
-         $this->element('script', array('type' => $type,
-                                                'src' => $src),
-                                ' ');
      }
  
 +    /**
 +     * output a script (almost always javascript) tag with inline
 +     * code.
 +     *
 +     * @param string $code          relative or absolute script path
 +     * @param string $type         'type' attribute value of the tag
 +     *
 +     * @return void
 +     */
 +
 +    function inlineScript($code, $type='text/javascript')
 +    {
 +        $this->elementStart('script', array('type' => $type));
 +        $this->raw('/*<![CDATA[*/ '); // XHTML compat for Safari
 +        $this->raw($code);
 +        $this->raw(' /*]]>*/'); // XHTML compat for Safari
 +        $this->elementEnd('script');
 +    }
 +
      /**
       * output a css link
       *