From e9ae51cfbca4ca4c2a5e9a2c452031e31985d093 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Thu, 7 Dec 2017 14:34:51 -0800 Subject: fix loading of theme-specific widgets --- Zotlabs/Render/Comanche.php | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'Zotlabs/Render/Comanche.php') diff --git a/Zotlabs/Render/Comanche.php b/Zotlabs/Render/Comanche.php index cd06e11a8..fb400b6fe 100644 --- a/Zotlabs/Render/Comanche.php +++ b/Zotlabs/Render/Comanche.php @@ -534,7 +534,12 @@ class Comanche { require_once('widget/' . $clsname . '/' . $clsname . '.php'); elseif(file_exists('Zotlabs/Widget/' . $clsname . '.php')) require_once('Zotlabs/Widget/' . $clsname . '.php'); - + else { + $pth = theme_include($clsname . '.php'); + if($pth) { + require_once($pth); + } + } if(class_exists($nsname)) { $x = new $nsname; $f = 'widget'; @@ -550,11 +555,13 @@ class Comanche { require_once('widget/' . trim($name) . '.php'); elseif(file_exists('widget/' . trim($name) . '/' . trim($name) . '.php')) require_once('widget/' . trim($name) . '/' . trim($name) . '.php'); - } - else { - $theme_widget = $func . '.php'; - if((! function_exists($func)) && theme_include($theme_widget)) - require_once(theme_include($theme_widget)); + + if(! function_exists($func)) { + $theme_widget = $func . '.php'; + if(theme_include($theme_widget)) { + require_once(theme_include($theme_widget)); + } + } } if(function_exists($func)) -- cgit v1.2.3