diff options
Diffstat (limited to 'Zotlabs/Render')
-rw-r--r-- | Zotlabs/Render/Comanche.php | 17 | ||||
-rw-r--r-- | Zotlabs/Render/Theme.php | 12 |
2 files changed, 24 insertions, 5 deletions
diff --git a/Zotlabs/Render/Comanche.php b/Zotlabs/Render/Comanche.php index 5826063fd..5c1ca7d10 100644 --- a/Zotlabs/Render/Comanche.php +++ b/Zotlabs/Render/Comanche.php @@ -4,8 +4,6 @@ namespace Zotlabs\Render; require_once('include/security.php'); require_once('include/menu.php'); -require_once('include/widgets.php'); - class Comanche { @@ -410,6 +408,21 @@ class Comanche { } } + $clsname = ucfirst($name); + $nsname = "\\Zotlabs\\Widget\\" . $clsname; + + if(file_exists('Zotlabs/SiteWidget/' . $clsname . '.php')) + require_once('Zotlabs/SiteWidget/' . $clsname . '.php'); + elseif(file_exists('Zotlabs/Widget/' . $clsname . '.php')) + require_once('Zotlabs/Widget/' . $clsname . '.php'); + if(class_exists($nsname)) { + $x = new $nsname; + $f = 'widget'; + if(method_exists($x,$f)) { + return $x->$f($vars); + } + } + $func = 'widget_' . trim($name); if(! function_exists($func)) { diff --git a/Zotlabs/Render/Theme.php b/Zotlabs/Render/Theme.php index 9f9009d72..3a0116abe 100644 --- a/Zotlabs/Render/Theme.php +++ b/Zotlabs/Render/Theme.php @@ -70,9 +70,15 @@ class Theme { $chosen_theme = $_GET['theme_preview']; // Allow theme selection of the form 'theme_name:schema_name' - $themepair = explode(':', $chosen_theme); + // Check if $chosen_theme is compatible with core. If not fall back to default + $info = get_theme_info($themepair[0]); + $compatible = check_plugin_versions($info); + if(!$compatible) { + $chosen_theme = ''; + } + if($chosen_theme && (file_exists('view/theme/' . $themepair[0] . '/css/style.css') || file_exists('view/theme/' . $themepair[0] . '/php/style.php'))) { return($themepair); } @@ -125,9 +131,9 @@ class Theme { $opts .= $schema_str; if(file_exists('view/theme/' . $t . '/php/style.php')) - return('view/theme/' . $t . '/php/style.pcss' . $opts); + return('/view/theme/' . $t . '/php/style.pcss' . $opts); - return('view/theme/' . $t . '/css/style.css'); + return('/view/theme/' . $t . '/css/style.css'); } function debug() { |