diff options
Diffstat (limited to 'index.php')
-rwxr-xr-x | index.php | 23 |
1 files changed, 16 insertions, 7 deletions
@@ -11,6 +11,10 @@ * bootstrap the application */ require_once('boot.php'); + +if(file_exists('.htsite.php')) + include('.htsite.php'); + // our global App object $a = new App; @@ -285,9 +289,12 @@ if($a->module_loaded) { */ if(function_exists($a->module . '_init')) { - call_hooks($a->module . '_mod_init', $placeholder); - $func = $a->module . '_init'; - $func($a); + $arr = array('init' => true, 'replace' => false); + call_hooks($a->module . '_mod_init', $arr); + if(! $arr['replace']) { + $func = $a->module . '_init'; + $func($a); + } } /** @@ -329,18 +336,20 @@ if($a->module_loaded) { if(($_SERVER['REQUEST_METHOD'] === 'POST') && (! $a->error) && (function_exists($a->module . '_post')) - && (! x($_POST, 'auth-params'))) { + && (! x($_POST, 'auth-params'))) { call_hooks($a->module . '_mod_post', $_POST); $func = $a->module . '_post'; $func($a); } if((! $a->error) && (function_exists($a->module . '_content'))) { - $arr = array('content' => $a->page['content']); + $arr = array('content' => $a->page['content'], 'replace' => false); call_hooks($a->module . '_mod_content', $arr); $a->page['content'] = $arr['content']; - $func = $a->module . '_content'; - $arr = array('content' => $func($a)); + if(! $arr['replace']) { + $func = $a->module . '_content'; + $arr = array('content' => $func($a)); + } call_hooks($a->module . '_mod_aftercontent', $arr); $a->page['content'] .= $arr['content']; } |