aboutsummaryrefslogtreecommitdiffstats
path: root/index.php
diff options
context:
space:
mode:
authorhabeascodice <habeascodice@federated.social>2014-11-01 03:04:11 -0700
committerhabeascodice <habeascodice@federated.social>2014-11-01 03:04:11 -0700
commit31376de0665091f2dba04755562ccd238d57a13c (patch)
treeae59c8697b9fd20c33aeaf8acb3a698b63e9657b /index.php
parentc854f8c238da2df08b52249142ad24ef66e422d1 (diff)
parent50c16c394fe2d966c62d30930600212a4e33303e (diff)
downloadvolse-hubzilla-31376de0665091f2dba04755562ccd238d57a13c.tar.gz
volse-hubzilla-31376de0665091f2dba04755562ccd238d57a13c.tar.bz2
volse-hubzilla-31376de0665091f2dba04755562ccd238d57a13c.zip
Merge remote branch 'upstream/master'
Diffstat (limited to 'index.php')
-rwxr-xr-xindex.php54
1 files changed, 45 insertions, 9 deletions
diff --git a/index.php b/index.php
index 6c18cbcb8..ae8a2e17d 100755
--- a/index.php
+++ b/index.php
@@ -197,7 +197,19 @@ if(strlen($a->module)) {
*/
if(! $a->module_loaded) {
- if(file_exists("custom/{$a->module}.php")) {
+
+ /*
+ * Traditionally we looked in custom first, but we're leaning toward a convention where site
+ * specific things are all in directories called 'site'. So custom will be going away.
+ * There are a very small number of folks affected. You know who you are. Once you've got things sorted,
+ * please remove the lines for "custom/" and push to the project repository.
+ */
+
+ if(file_exists("mod/site/{$a->module}.php")) {
+ include_once("mod/site/{$a->module}.php");
+ $a->module_loaded = true;
+ }
+ elseif(file_exists("custom/{$a->module}.php")) {
include_once("custom/{$a->module}.php");
$a->module_loaded = true;
}
@@ -242,14 +254,6 @@ if(strlen($a->module)) {
}
}
-/**
- * load current theme info
- */
-$theme_info_file = "view/theme/".current_theme()."/php/theme.php";
-if (file_exists($theme_info_file)){
- require_once($theme_info_file);
-}
-
/* initialise content region */
@@ -281,12 +285,44 @@ if($a->module_loaded) {
$a->page['page_title'] = $a->module;
$placeholder = '';
+ /**
+ * No theme has been specified when calling the module_init functions
+ * For this reason, please restrict the use of templates to those which
+ * do not provide any presentation details - as themes will not be able
+ * to over-ride them.
+ */
+
if(function_exists($a->module . '_init')) {
call_hooks($a->module . '_mod_init', $placeholder);
$func = $a->module . '_init';
$func($a);
}
+ /**
+ * Do all theme initialiasion here before calling any additional module functions.
+ * The module_init function may have changed the theme.
+ * Additionally any page with a Comanche template may alter the theme.
+ * So we'll check for those now.
+ */
+
+
+ /**
+ * In case a page has overloaded a module, see if we already have a layout defined
+ * otherwise, if a PDL file exists for this module, use it
+ * The member may have also created a customised PDL that's stored in the config
+ */
+
+ load_pdl($a);
+
+ /**
+ * load current theme info
+ */
+
+ $theme_info_file = "view/theme/".current_theme()."/php/theme.php";
+ if (file_exists($theme_info_file)){
+ require_once($theme_info_file);
+ }
+
if(function_exists(str_replace('-','_',current_theme()) . '_init')) {
$func = str_replace('-','_',current_theme()) . '_init';
$func($a);