Bug #9455: Add ability to output full URL for CSS
authorMichael M Slusarz <slusarz@curecanti.org>
Fri, 21 Jan 2011 19:47:52 +0000 (12:47 -0700)
committerMichael M Slusarz <slusarz@curecanti.org>
Fri, 21 Jan 2011 19:51:54 +0000 (12:51 -0700)
framework/Core/lib/Horde.php
framework/Core/lib/Horde/Themes/Css.php

index ccd9f85..afe0fce 100644 (file)
@@ -1416,11 +1416,13 @@ HTML;
      *
      * @param array $opts  Options to pass to
      *                     Horde_Themes_Css::getStylesheetUrls().
+     * @param array $full  Return a full URL?
      */
-    static public function includeStylesheetFiles(array $opts = array())
+    static public function includeStylesheetFiles(array $opts = array(),
+                                                  $full = false)
     {
         foreach ($GLOBALS['injector']->getInstance('Horde_Themes_Css')->getStylesheetUrls($opts) as $val) {
-            echo '<link href="' . $val . '" rel="stylesheet" type="text/css" />';
+            echo '<link href="' . $val->toString(false, $full) . '" rel="stylesheet" type="text/css" />';
         }
     }
 
index b2e03c5..1dc06ed 100644 (file)
@@ -74,7 +74,7 @@ class Horde_Themes_Css
      * 'themeonly' - (boolean) If true, only load the theme files.
      * </pre>
      *
-     * @return array  The list of URLs to display.
+     * @return array  The list of URLs to display (Horde_Url objects).
      */
     public function getStylesheetUrls(array $opts = array())
     {
@@ -95,7 +95,7 @@ class Horde_Themes_Css
         if ($cache_type == 'none') {
             $css_out = array();
             foreach ($css as $file) {
-                $css_out[] = $file['uri'];
+                $css_out[] = Horde::url($file['uri'], true, array('append_session' => -1));
             }
             return $css_out;
         }
@@ -107,7 +107,7 @@ class Horde_Themes_Css
         case 'filesystem':
             $css_filename = '/static/' . $sig . '.css';
             $css_path = $registry->get('fileroot', 'horde') . $css_filename;
-            $css_url = $registry->get('webroot', 'horde') . $css_filename;
+            $css_url = Horde::url($registry->get('webroot', 'horde') . $css_filename, true, array('append_session' => -1));
             $exists = file_exists($css_path);
             break;