]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Added cssLink() and script() functions to htmloutputter
authorCraig Andrews <candrews@integralblue.com>
Wed, 5 Aug 2009 23:35:42 +0000 (19:35 -0400)
committerCraig Andrews <candrews@integralblue.com>
Wed, 5 Aug 2009 23:35:42 +0000 (19:35 -0400)
lib/htmloutputter.php

index 5da1fbe148338d25d954a8298d6c4182aaf4c447..0b4c1405a8a3e9048b6b1289262afc536333bf00 100644 (file)
@@ -339,6 +339,42 @@ class HTMLOutputter extends XMLOutputter
                                       'title' => $title));
     }
 
+    /**
+     * output a script (almost always javascript) tag
+     *
+     * @param string $src          relative or absolute script path
+     * @param string $type         'type' attribute value of the tag
+     *
+     * @return void
+     */
+    function script($src, $type='text/javascript')
+    {
+        $this->element('script', array('type' => $type,
+                                               'src' => common_path($src) . '?version=' . LACONICA_VERSION),
+                               ' ');
+    }
+
+    /**
+     * output a css link
+     *
+     * @param string $relative     relative path within the theme directory
+     * @param string $theme        'theme' that contains the stylesheet
+     * @param string media         'media' attribute of the tag
+     *
+     * @return void
+     */
+    function cssLink($relative,$theme,$media)
+    {
+        if (!$theme) {
+            $theme = common_config('site', 'theme');
+        }
+
+        $this->element('link', array('rel' => 'stylesheet',
+                                'type' => 'text/css',
+                                'href' => theme_path($relative, $theme) . '?version=' . LACONICA_VERSION,
+                                'media' => $media));
+    }
+
     /**
      * output an HTML textarea and associated elements
      *