http://www.atutor.ca/atutor/mantis/view.php?id=2625
authorjoel kronenberg <joel.kronenberg@utoronto.ca>
Thu, 6 Jul 2006 15:03:02 +0000 (15:03 -0000)
committerjoel kronenberg <joel.kronenberg@utoronto.ca>
Thu, 6 Jul 2006 15:03:02 +0000 (15:03 -0000)
docs/include/vitals.inc.php
docs/themes/default/theme.cfg.php

index abbeb66..09c46bc 100644 (file)
@@ -200,6 +200,9 @@ require(AT_INCLUDE_PATH.'phpCache/phpCache.inc.php'); // 6. cache library
        if (isset($_SESSION['prefs']['PREF_THEME']) && file_exists(AT_INCLUDE_PATH . '../themes/' . $_SESSION['prefs']['PREF_THEME']) && $_SESSION['valid_user']) {
 
                if ($_SESSION['course_id'] == -1) {
+                       if (!is_dir(AT_INCLUDE_PATH . '../themes/' . $_SESSION['prefs']['PREF_THEME'])) {
+                               $_SESSION['prefs']['PREF_THEME'] = 'default';
+                       }
                        $savant->addPath('template', AT_INCLUDE_PATH . '../themes/' . $_SESSION['prefs']['PREF_THEME'] . '/');
                } else {
                        //check if enabled
@@ -211,21 +214,25 @@ require(AT_INCLUDE_PATH.'phpCache/phpCache.inc.php'); // 6. cache library
                        } else {
                                // get default
                                $default_theme = get_default_theme();
+                               if (!is_dir(AT_INCLUDE_PATH . '../themes/' . $default_theme['dir_name'])) {
+                                       $default_theme = array('dir_name' => 'default');
+                               }
                                $savant->addPath('template', AT_INCLUDE_PATH . '../themes/' . $default_theme['dir_name'] . '/');
                                $_SESSION['prefs']['PREF_THEME'] = $default_theme['dir_name'];
                        }
                }
        } else {
-
                // get default
                $default_theme = get_default_theme();
+               if (!is_dir(AT_INCLUDE_PATH . '../themes/' . $default_theme['dir_name'])) {
+                       $default_theme = array('dir_name' => 'default');
+               }
                $savant->addPath('template', AT_INCLUDE_PATH . '../themes/' . $default_theme['dir_name'] . '/');
                $_SESSION['prefs']['PREF_THEME'] = $default_theme['dir_name'];
        }
 
        require(AT_INCLUDE_PATH . '../themes/' . $_SESSION['prefs']['PREF_THEME'] . '/theme.cfg.php');
 
-
        require(AT_INCLUDE_PATH.'classes/Message/Message.class.php');
        $msg =& new Message($savant);
 
index c0fd7ed..b00140c 100644 (file)
@@ -40,4 +40,4 @@
        $_theme['banner']['vertical-align']   = 'middle';
        $_theme['banner']['padding']          = '3px';
 
-?>
+?>
\ No newline at end of file