patch against Turba HEAD to fix styles issue

Ronnie Garcia ronnie@mk2.net
Tue, 19 Mar 2002 11:50:34 +0100


---------------------- multipart/mixed attachment
  This one fixes ListView::display witch was loading html.php
  It does now check for prefs settings and attempts to load the right 
stylesheet if present.

Rgds,
Ronnie.
---------------------- multipart/mixed attachment
--- ListView.php.dist   Tue Mar 19 11:42:52 2002
+++ ListView.php        Tue Mar 19 11:38:34 2002
@@ -42,7 +42,23 @@
      */
     function display()
     {
-        include TURBA_BASE . '/config/html.php';
+        global $prefs;
+
+        /* attempt to load styles */
+        $theme = '';
+        if (isset($prefs)) {
+            $theme = $prefs->getValue('theme');
+        }
+
+        if (!empty($theme) && @file_exists(TURBA_BASE . '/config/themes/html-' . $theme . '.php')) {
+            $file = TURBA_BASE . '/config/themes/html-' . $theme . '.php';
+        } elseif (@file_exists(TURBA_BASE . '/config/html.php')) {
+            $file = TURBA_BASE . '/config/html.php';
+        } else {
+            $file = TURBA_BASE . '/config/html.php.dist';
+        }
+        include $file;
+
         $i = 0;
         $this->list->reset();
         while ($ob = $this->list->next()) {

---------------------- multipart/mixed attachment--