aboutsummaryrefslogtreecommitdiffstats
path: root/index.php
diff options
context:
space:
mode:
Diffstat (limited to 'index.php')
-rwxr-xr-xindex.php26
1 files changed, 19 insertions, 7 deletions
diff --git a/index.php b/index.php
index 6ed7eeb11..2b486b487 100755
--- a/index.php
+++ b/index.php
@@ -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;
@@ -24,6 +28,9 @@ $a->install = ((file_exists('.htconfig.php') && filesize('.htconfig.php')) ? fal
@include('.htconfig.php');
+if(! defined('UNO'))
+ define('UNO', 0);
+
$a->timezone = ((x($default_timezone)) ? $default_timezone : 'UTC');
date_default_timezone_set($a->timezone);
@@ -285,9 +292,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 +339,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'];
}