diff options
Diffstat (limited to 'Zotlabs/Render')
-rw-r--r-- | Zotlabs/Render/SmartyInterface.php | 10 | ||||
-rw-r--r-- | Zotlabs/Render/Theme.php | 15 |
2 files changed, 15 insertions, 10 deletions
diff --git a/Zotlabs/Render/SmartyInterface.php b/Zotlabs/Render/SmartyInterface.php index 64c6aa377..003262939 100644 --- a/Zotlabs/Render/SmartyInterface.php +++ b/Zotlabs/Render/SmartyInterface.php @@ -2,7 +2,7 @@ namespace Zotlabs\Render; -use Smarty; +use Smarty\Smarty; use App; class SmartyInterface extends Smarty { @@ -19,20 +19,20 @@ class SmartyInterface extends Smarty { // The order is thus very important here $template_dirs = array('theme' => "view/theme/$thname/tpl/"); - if ( x(App::$theme_info,"extends") ) { + if (!empty(App::$theme_info['extends'])) { $template_dirs = $template_dirs + array('extends' => "view/theme/" . App::$theme_info["extends"] . "/tpl/"); } $template_dirs = $template_dirs + array('base' => 'view/tpl/'); $this->setTemplateDir($template_dirs); $basecompiledir = App::$config['system']['smarty3_folder']; - + $this->setCompileDir($basecompiledir.'/compiled/'); $this->setConfigDir($basecompiledir.'/config/'); $this->setCacheDir($basecompiledir.'/cache/'); - $this->left_delimiter = App::get_template_ldelim('smarty3'); - $this->right_delimiter = App::get_template_rdelim('smarty3'); + $this->setLeftDelimiter(App::get_template_ldelim('smarty3')); + $this->setRightDelimiter(App::get_template_rdelim('smarty3')); // Don't report errors so verbosely $this->error_reporting = E_ALL & ~E_WARNING & ~E_NOTICE; diff --git a/Zotlabs/Render/Theme.php b/Zotlabs/Render/Theme.php index a42b65e03..2faf3631a 100644 --- a/Zotlabs/Render/Theme.php +++ b/Zotlabs/Render/Theme.php @@ -26,9 +26,9 @@ class Theme { */ static public function current() { - self::$system_theme = ((isset(App::$config['system']['theme'])) + self::$system_theme = ((!empty(App::$config['system']['theme'])) ? App::$config['system']['theme'] : ''); - self::$session_theme = ((isset($_SESSION) && x($_SESSION, 'theme')) + self::$session_theme = ((!empty($_SESSION['theme'])) ? $_SESSION['theme'] : self::$system_theme); $page_theme = null; @@ -87,8 +87,13 @@ class Theme { // Find any theme at all and use it. $fallback = array_merge(glob('view/theme/*/css/style.css'), glob('view/theme/*/php/style.php')); - if(count($fallback)) - return(array(str_replace('view/theme/', '', substr($fallback[0], 0, -14)))); + + if (empty($fallback)) { + logger('Unable to find a theme'); + http_status_exit(500, 'internal server error'); + } + + return(array(str_replace('view/theme/', '', substr($fallback[0], 0, -14)))); } @@ -111,7 +116,7 @@ class Theme { $opts = ''; $opts = (($uid) ? '?puid=' . $uid : ''); - $schema_str = ((x(App::$layout,'schema')) ? '&schema=' . App::$layout['schema'] : ''); + $schema_str = ((!empty(App::$layout['schema'])) ? '&schema=' . App::$layout['schema'] : ''); if(($s) && (! $schema_str)) $schema_str = '&schema=' . $s; |