aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Render/Comanche.php
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2017-03-15 16:55:47 -0700
committerMario Vavti <mario@mariovavti.com>2017-03-29 11:45:54 +0200
commit755b75161494ea9810ab0e38242cb1a318793ed3 (patch)
tree5f6ae2ad6e47b2e503e5dca2c8be9ec16d1f81ab /Zotlabs/Render/Comanche.php
parent5564b47dbc640b30a8090a6138f0c2f841accbe9 (diff)
downloadvolse-hubzilla-755b75161494ea9810ab0e38242cb1a318793ed3.tar.gz
volse-hubzilla-755b75161494ea9810ab0e38242cb1a318793ed3.tar.bz2
volse-hubzilla-755b75161494ea9810ab0e38242cb1a318793ed3.zip
Comanche: allow widgets to be class based and stored appropriately in Zotlabs
Diffstat (limited to 'Zotlabs/Render/Comanche.php')
-rw-r--r--Zotlabs/Render/Comanche.php14
1 files changed, 14 insertions, 0 deletions
diff --git a/Zotlabs/Render/Comanche.php b/Zotlabs/Render/Comanche.php
index 5826063fd..899fbd8aa 100644
--- a/Zotlabs/Render/Comanche.php
+++ b/Zotlabs/Render/Comanche.php
@@ -410,6 +410,20 @@ 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)) {