]> git.mxchange.org Git - mailer.git/blobdiff - inc/module-functions.php
Added script template for cron jobs, fixed some checks on CSS/HTML mode
[mailer.git] / inc / module-functions.php
index cf0ea0d049c190ed50e747df9ee77ab5d1edbac9..3bc6dadb4d2fdefbe2732b051fe8cc0bd7562ed8 100644 (file)
@@ -116,7 +116,7 @@ function getModuleStatus ($module) {
        // Is the module_status entry there?
        if (!isModuleStatusSet($module)) {
                // Abort
-               reportBug('Module status not set. module=' . $module);
+               reportBug(__FUNCTION__, __LINE__, 'Module status not set. module=' . $module);
        } // END - if
 
        // Return it
@@ -388,9 +388,9 @@ function ifModuleHasMenu ($module, $forceDb = FALSE) {
        } elseif (!isExtensionInstalled('sql_patches')) {
                // No ext-sql_patches installed, so maybe in admin/guest/member/sponsor area or no admin registered?
                $ret = in_array($module, array('admin', 'index', 'login', 'sponsor')); // Then there is a menu!
-       } else {
-               // Unsupported state!
-               logDebugMessage(__FUNCTION__, __LINE__, 'This should never be reached.');
+       } elseif (!isInstallationPhase()) {
+               // Unsupported state, but ignored in installation phase
+               logDebugMessage(__FUNCTION__, __LINE__, 'This should never be reached, module[' . gettype($module) . ']=' . $module . ',forceDb=' . intval($forceDb));
        }
 
        // Return status
@@ -421,7 +421,7 @@ function loadModule () {
        $isModuleValid = FALSE;
 
        // Construct module name
-       $GLOBALS['module_inc'] =  sprintf("inc/modules/%s.php", getModule());
+       $GLOBALS['module_inc'] = sprintf("inc/modules/%s.php", getModule());
 
        // Check module permission (again)
        $moduleState = checkModulePermissions();
@@ -529,8 +529,8 @@ function doIncludeModule () {
 function getMenuModeFromModule () {
        // Is cache set?
        if (!isset($GLOBALS[__FUNCTION__])) {
-               // Default is NULL
-               $GLOBALS[__FUNCTION__] = NULL;
+               // Default is 'noindex' which is invalid for SQL tables but okay for meta data template
+               $GLOBALS[__FUNCTION__] = 'noindex';
 
                // Determine it hard-coded
                if (getModule() == 'login') {
@@ -542,6 +542,9 @@ function getMenuModeFromModule () {
                } elseif (getModule() == 'admin') {
                        // Is admin area
                        $GLOBALS[__FUNCTION__] = 'admin';
+               } elseif (isInstallationPhase()) {
+                       // Is installation phase
+                       $GLOBALS[__FUNCTION__] = 'install';
                } else {
                        // Get it from filter
                        $GLOBALS[__FUNCTION__] = runFilterChain('determine_menu_mode');