setModuleStatus($module_chk, 'major');
// Check if script is installed if not return a 'done' to prevent some errors
- if ((isInstallationPhase()) || (!isAdminRegistered())) {
+ if ((isInstaller()) || (!isAdminRegistered())) {
// Not installed or no admin registered or in installation phase
setModuleStatus($module_chk, 'done');
setModuleStatus($module_chk, 'admin_only');
} else {
// @TODO Nothing helped???
- logDebugMessage(__FUNCTION__, __LINE__, sprintf("ret=%s,locked=%d,hidden=%d,mem=%d,admin=%d",
+ logDebugMessage(__FUNCTION__, __LINE__, sprintf('ret=%s,locked=%d,hidden=%d,mem=%d,admin=%d',
getModuleStatus($module_chk),
intval(isModuleLocked($module_chk)),
intval(isModuleHidden($module_chk)),
// Still no luck or not found?
if (($found === FALSE) && (!isExtensionActive('cache')) && (getModuleStatus($module_chk) != 'done')) {
// ----- Default module ----- ---- Module in base folder ---- --- Module with extension's name ---
- if ((isIncludeReadable(sprintf("inc/modules/%s.php", $module))) || (isIncludeReadable(sprintf("%s.php", $module))) || (isIncludeReadable(sprintf("%s/%s.php", $extension, $module)))) {
+ if ((isIncludeReadable(sprintf('inc/modules/%s.php', $module))) || (isIncludeReadable($module . '.php')) || (isIncludeReadable(sprintf('%s/%s.php', $extension, $module)))) {
// Data is missing so we add it
if (isExtensionInstalledAndNewer('sql_patches', '0.3.6')) {
/*
rebuildCache('modules', 'modules');
} elseif ($found === FALSE) {
// Problem with module detected
- logDebugMessage(__FUNCTION__, __LINE__, sprintf("Problem in module %s detected. getModuleStatus()=%s,locked=%d,hidden=%d,mem=%d,admin=%d,output_mode=%s",
+ logDebugMessage(__FUNCTION__, __LINE__, sprintf('Problem in module %s detected. getModuleStatus()=%s,locked=%d,hidden=%d,mem=%d,admin=%d,output_mode=%s',
$module_chk,
getModuleStatus($module_chk),
intval(isModuleLocked($module_chk)),
}
// Debug log
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, sprintf("module=%s, status=%s", $module_chk, getModuleStatus($module_chk)));
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, sprintf('module=%s, status=%s', $module_chk, getModuleStatus($module_chk)));
// Return the value
return getModuleStatus($module_chk);
} 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!
- } elseif (!isInstallationPhase()) {
+ } elseif (!isInstaller()) {
// Unsupported state, but ignored in installation phase
logDebugMessage(__FUNCTION__, __LINE__, 'This should never be reached, module[' . gettype($module) . ']=' . $module . ',forceDb=' . intval($forceDb));
}
addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_mod_reg` (`module`, `title`, `locked`, `hidden`, `admin_only`, `mem_only`) VALUES ('" . $module . "', '" . $title . "', '" . $locked . "', '" . $hidden . "', '" . $adminOnly . "', '" . $memOnly . "')");
} else {
// Already registered
- logDebugMessage(__FUNCTION__, __LINE__, sprintf("Already registered: module=%s,locked=%s,hidden=%s,admin=%s,mem=%s",
+ logDebugMessage(__FUNCTION__, __LINE__, sprintf('Already registered: module=%s,locked=%s,hidden=%s,admin=%s,mem=%s',
$module,
$locked,
$hidden,
$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();
default:
// Unknown module status
- logDebugMessage(__FUNCTION__, __LINE__, sprintf("Unknown status %s return from module check. Module=%s", $moduleState, getModule()));
+ logDebugMessage(__FUNCTION__, __LINE__, sprintf('Unknown status %s return from module check. Module=%s', $moduleState, getModule()));
addFatalMessage(__FUNCTION__, __LINE__, '{%message,UNKNOWN_MODULE_STATUS=' . $moduleState . '%}');
break;
} // END - switch
} elseif (getModule() == 'admin') {
// Is admin area
$GLOBALS[__FUNCTION__] = 'admin';
- } elseif (isInstallationPhase()) {
+ } elseif (isInstaller()) {
// Is installation phase
$GLOBALS[__FUNCTION__] = 'install';
} else {