aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Web
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2018-09-17 10:30:47 +0200
committerMario Vavti <mario@mariovavti.com>2018-09-17 10:30:47 +0200
commit2f6cb764a4670f848123153e44d6aa58d6ab01b7 (patch)
treeff4e32768f0960cdf92fd279112aa18513b9bffb /Zotlabs/Web
parent07cd1d1272bd301c2f41f5579697754ccbbf5ae3 (diff)
downloadvolse-hubzilla-2f6cb764a4670f848123153e44d6aa58d6ab01b7.tar.gz
volse-hubzilla-2f6cb764a4670f848123153e44d6aa58d6ab01b7.tar.bz2
volse-hubzilla-2f6cb764a4670f848123153e44d6aa58d6ab01b7.zip
prepare submodule to interact with route
Diffstat (limited to 'Zotlabs/Web')
-rw-r--r--Zotlabs/Web/SubModule.php17
1 files changed, 17 insertions, 0 deletions
diff --git a/Zotlabs/Web/SubModule.php b/Zotlabs/Web/SubModule.php
index 7c8404201..763a55d86 100644
--- a/Zotlabs/Web/SubModule.php
+++ b/Zotlabs/Web/SubModule.php
@@ -2,6 +2,8 @@
namespace Zotlabs\Web;
+use Zotlabs\Extend\Route;
+
/*
* @brief
*
@@ -31,9 +33,23 @@ class SubModule {
$filename = 'Zotlabs/Module/' . ucfirst(argv(0)) . '/'. ucfirst(argv($whicharg)) . '.php';
$modname = '\\Zotlabs\\Module\\' . ucfirst(argv(0)) . '\\' . ucfirst(argv($whicharg));
+
if(file_exists($filename)) {
$this->controller = new $modname();
}
+
+ $routes = Route::get();
+
+ if($routes) {
+ foreach($routes as $route) {
+ if(is_array($route) && strtolower($route[1]) === strtolower(argv(0)) . '/' . strtolower(argv($whicharg))) {
+ include_once($route[0]);
+ if(class_exists($modname)) {
+ $this->controller = new $modname;
+ }
+ }
+ }
+ }
}
/**
@@ -43,6 +59,7 @@ class SubModule {
* @return boolean|mixed
*/
function call($method) {
+
if(! $this->controller)
return false;