aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Render
diff options
context:
space:
mode:
Diffstat (limited to 'Zotlabs/Render')
-rw-r--r--Zotlabs/Render/Comanche.php34
1 files changed, 24 insertions, 10 deletions
diff --git a/Zotlabs/Render/Comanche.php b/Zotlabs/Render/Comanche.php
index fb400b6fe..f58dba60e 100644
--- a/Zotlabs/Render/Comanche.php
+++ b/Zotlabs/Render/Comanche.php
@@ -528,18 +528,32 @@ 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('widget/' . $clsname . '/' . $clsname . '.php'))
- 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);
+ $found = false;
+ $widgets = \Zotlabs\Extend\Widget::get();
+ if($widgets) {
+ foreach($widgets as $widget) {
+ if(is_array($widget) && strtolower($widget[1]) === strtolower($name) && file_exists($widget[0])) {
+ require_once($widget[0]);
+ $found = true;
+ }
}
}
+
+ if(! $found) {
+ if(file_exists('Zotlabs/SiteWidget/' . $clsname . '.php'))
+ require_once('Zotlabs/SiteWidget/' . $clsname . '.php');
+ elseif(file_exists('widget/' . $clsname . '/' . $clsname . '.php'))
+ 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';