aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Web
diff options
context:
space:
mode:
authorredmatrix <git@macgirvin.com>2016-04-15 01:25:15 -0700
committerredmatrix <git@macgirvin.com>2016-04-15 01:25:15 -0700
commitaaa327ca056fe8d1315b8fff9bb08b1c1d40fa1c (patch)
treee88b650a394265eb14857903718be5d003789c03 /Zotlabs/Web
parentf124f4a9f5244644231e541d430e5f80e4f863e2 (diff)
downloadvolse-hubzilla-aaa327ca056fe8d1315b8fff9bb08b1c1d40fa1c.tar.gz
volse-hubzilla-aaa327ca056fe8d1315b8fff9bb08b1c1d40fa1c.tar.bz2
volse-hubzilla-aaa327ca056fe8d1315b8fff9bb08b1c1d40fa1c.zip
testing the new router/module code
Diffstat (limited to 'Zotlabs/Web')
-rw-r--r--Zotlabs/Web/Router.php22
1 files changed, 21 insertions, 1 deletions
diff --git a/Zotlabs/Web/Router.php b/Zotlabs/Web/Router.php
index 29f2b5206..699b27891 100644
--- a/Zotlabs/Web/Router.php
+++ b/Zotlabs/Web/Router.php
@@ -54,7 +54,17 @@ class Router {
*/
if(! (\App::$module_loaded)) {
- if(file_exists("mod/site/{$module}.php")) {
+ $newmod = ucfirst($module);
+logger('0' . "Zotlabs/Module/{$newmod}.php");
+ if(file_exists("Zotlabs/Module/{$newmod}.php")) {
+logger('1' . "Zotlabs/Module/{$newmod}.php");
+ include_once("Zotlabs/Module/{$newmod}.php");
+logger('2');
+ if(class_exists("Zotlabs\\Module\\{$newmod}"))
+ \App::$module_loaded = true;
+logger('3');
+ }
+ elseif(file_exists("mod/site/{$module}.php")) {
include_once("mod/site/{$module}.php");
\App::$module_loaded = true;
}
@@ -122,6 +132,12 @@ class Router {
* Call module functions
*/
+ $nmod = false;
+
+ $newmod = ucfirst(\App::$module);
+ if(class_exists("Zotlabs\\Module\\{$newmod}"))
+ $nmod = true;
+
if(\App::$module_loaded) {
\App::$page['page_title'] = \App::$module;
$placeholder = '';
@@ -133,6 +149,10 @@ class Router {
* to over-ride them.
*/
+ $modname = (($nmod) ? "Zotlabs\\Module\\{$newmod}" : '');
+ if($modname && method_exists($modname,'init'))
+ logger('function_exists: ' . $modname . '->init');
+
if(function_exists(\App::$module . '_init')) {
$arr = array('init' => true, 'replace' => false);
call_hooks(\App::$module . '_mod_init', $arr);