From 07650b4646137e35ec975664ee69f077c9f370d3 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Fri, 15 Apr 2016 16:13:55 -0700 Subject: get init() working with class modules --- Zotlabs/Web/Controller.php | 12 ++++++++++++ Zotlabs/Web/Router.php | 24 +++++++++++++++--------- 2 files changed, 27 insertions(+), 9 deletions(-) create mode 100644 Zotlabs/Web/Controller.php (limited to 'Zotlabs') diff --git a/Zotlabs/Web/Controller.php b/Zotlabs/Web/Controller.php new file mode 100644 index 000000000..ac835e008 --- /dev/null +++ b/Zotlabs/Web/Controller.php @@ -0,0 +1,12 @@ +init'); - - if(function_exists(\App::$module . '_init')) { - $arr = array('init' => true, 'replace' => false); - call_hooks(\App::$module . '_mod_init', $arr); - if(! $arr['replace']) { + $arr = array('init' => true, 'replace' => false); + call_hooks(\App::$module . '_mod_init', $arr); + if(! $arr['replace']) { + if($modname && method_exists($modname,'init')) { + logger('function_exists: ' . $modname . '->init'); + $modclass = new $modname; + $modclass->init(); + } + elseif(function_exists(\App::$module . '_init')) { $func = \App::$module . '_init'; $func($a); } @@ -199,6 +204,7 @@ logger('3'); } } + if(($_SERVER['REQUEST_METHOD'] === 'POST') && (! \App::$error) && (function_exists(\App::$module . '_post')) && (! x($_POST, 'auth-params'))) { -- cgit v1.2.3