aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Render
diff options
context:
space:
mode:
Diffstat (limited to 'Zotlabs/Render')
-rw-r--r--Zotlabs/Render/SmartyInterface.php2
-rw-r--r--Zotlabs/Render/Theme.php15
2 files changed, 11 insertions, 6 deletions
diff --git a/Zotlabs/Render/SmartyInterface.php b/Zotlabs/Render/SmartyInterface.php
index a319a4881..003262939 100644
--- a/Zotlabs/Render/SmartyInterface.php
+++ b/Zotlabs/Render/SmartyInterface.php
@@ -19,7 +19,7 @@ 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/');
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;