]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/theme.php
Misses this file to merge. I like the comments.
[quix0rs-gnu-social.git] / lib / theme.php
index b5f2b58cf2401ba142f8cbdbc242a831b63d8944..ef7290de2398ea2cdb973f3dea636f3831424a34 100644 (file)
@@ -53,6 +53,8 @@ if (!defined('STATUSNET') && !defined('LACONICA')) {
  */
 class Theme
 {
+    const FALLBACK = 'neo';
+
     var $name = null;
     var $dir  = null;
     var $path = null;
@@ -99,7 +101,19 @@ class Theme
         if (file_exists($fulldir) && is_dir($fulldir)) {
             $this->dir = $fulldir;
             $this->path = $this->relativeThemePath('theme', 'theme', $name);
+            return;
         }
+
+        // Ruh roh. Fall back to default, then.
+
+        common_log(LOG_WARNING, sprintf("Unable to find theme '%s', falling back to default theme '%s'",
+                                        $name,
+                                        Theme::FALLBACK));
+
+        $this->name = Theme::FALLBACK;
+        $this->dir  = $instroot.'/'.Theme::FALLBACK;
+        $this->path = $this->relativeThemePath('theme', 'theme', Theme::FALLBACK);
+
     }
 
     /**
@@ -116,7 +130,7 @@ class Theme
      */
     protected function relativeThemePath($group, $fallbackSubdir, $name)
     {
-        if (StatusNet::isHTTPS()) {
+        if (GNUsocial::isHTTPS()) {
             $sslserver = common_config($group, 'sslserver');
 
             if (empty($sslserver)) {