if (!defined('__SECURITY')) {
$INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
require($INC);
-} elseif ($GLOBALS['block_mode']) {
+} elseif (isBlockModeEnabled()) {
// Block mode detected
return;
}
if (!defined('__SECURITY')) {
$INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
require($INC);
-} elseif ($GLOBALS['block_mode']) {
+} elseif (isBlockModeEnabled()) {
// Block mode detected
return;
}
if (!defined('__SECURITY')) {
$INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
require($INC);
-} elseif ($GLOBALS['block_mode']) {
+} elseif (isBlockModeEnabled()) {
// Block mode detected
return;
}
} elseif ((!EXT_IS_ACTIVE('sponsor')) && (!IS_ADMIN())) {
addFatalMessage(__FILE__, __LINE__, generateExtensionInactiveNotInstalledMessage('sponsor'));
return;
-} elseif ($GLOBALS['block_mode']) {
+} elseif (isBlockModeEnabled()) {
// Block mode detected
return;
}
LOAD_TEMPLATE('guest_menu_content');
// Disable block-mode by default
-$GLOBALS['block_mode'] = false;
+enableBlockMode(false);
// Construct FQFN
$INC = sprintf("inc/modules/guest/action-%s.php", getAction());
define('__MEMBER_ADVERT', LOAD_TEMPLATE('member_banner', true));
// Disable block mode by default
-$GLOBALS['block_mode'] = false;
+enableBlockMode(false);
// Generate a tableset for the menu title and content
LOAD_TEMPLATE('member_header');
require($INC);
} elseif (!IS_MEMBER()) {
redirectToUrl('modules.php?module=index');
-} elseif ($GLOBALS['block_mode']) {
+} elseif (isBlockModeEnabled()) {
// Block mode detected
return;
}
} elseif ((!EXT_IS_ACTIVE('bank')) && (!IS_ADMIN())) {
addFatalMessage(__FILE__, __LINE__, generateExtensionInactiveNotInstalledMessage('bank'));
return;
-} elseif ($GLOBALS['block_mode']) {
+} elseif (isBlockModeEnabled()) {
// Block mode detected
return;
}
require($INC);
} elseif (!IS_MEMBER()) {
redirectToUrl('modules.php?module=index');
-} elseif ($GLOBALS['block_mode']) {
+} elseif (isBlockModeEnabled()) {
// Block mode detected
return;
}
require($INC);
} elseif (!IS_MEMBER()) {
redirectToUrl('modules.php?module=index');
-} elseif ($GLOBALS['block_mode']) {
+} elseif (isBlockModeEnabled()) {
// Block mode detected
return;
}
require($INC);
} elseif (!IS_MEMBER()) {
redirectToUrl('modules.php?module=index');
-} elseif ($GLOBALS['block_mode']) {
+} elseif (isBlockModeEnabled()) {
// Block mode detected
return;
}
} elseif ((!EXT_IS_ACTIVE('order')) && (!IS_ADMIN())) {
addFatalMessage(__FILE__, __LINE__, generateExtensionInactiveNotInstalledMessage('order'));
return;
-} elseif ($GLOBALS['block_mode']) {
+} elseif (isBlockModeEnabled()) {
// Block mode detected
return;
}
require($INC);
} elseif (!IS_MEMBER()) {
redirectToUrl('modules.php?module=index');
-} elseif ($GLOBALS['block_mode']) {
+} elseif (isBlockModeEnabled()) {
// Block mode detected
return;
}
require($INC);
} elseif (!IS_MEMBER()) {
redirectToUrl('modules.php?module=index');
-} elseif ($GLOBALS['block_mode']) {
+} elseif (isBlockModeEnabled()) {
// Block mode detected
return;
}
} elseif ((!EXT_IS_ACTIVE('surfbar')) && (!IS_ADMIN())) {
addFatalMessage(__FILE__, __LINE__, generateExtensionInactiveNotInstalledMessage('surfbar'));
return;
-} elseif ($GLOBALS['block_mode']) {
+} elseif (isBlockModeEnabled()) {
// Block mode detected
return;
}
// Set error handler
set_error_handler('__errorHandler');
+// Disable block-mode by default
+enableBlockMode(false);
+
// Init error handler
initErrorHandler();
} // END - if
// Load SQL data and add the menu to the output stream...
- $result_main = SQL_QUERY_ESC("SELECT title, action FROM `{!_MYSQL_PREFIX!}_%s_menu` WHERE (`what`='' OR `what` IS NULL)".$AND." ORDER BY `sort`",
- array($mode), __FUNCTION__, __LINE__);
+ $result_main = SQL_QUERY_ESC("SELECT `title`, `action` FROM `{!_MYSQL_PREFIX!}_%s_menu` WHERE (`what`='' OR `what` IS NULL)".$AND." ORDER BY `sort`",
+ array($mode), __FUNCTION__, __LINE__);
//* DEBUG: */ echo __LINE__.'/'.$main_cnt.'/'.$main_action.'/'.$sub_what.':'.getWhat()."*<br />\n";
if (SQL_NUMROWS($result_main) > 0) {
OUTPUT_HTML("<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" class=\"".$mode."_menu\">");
while ($content = SQL_FETCHARRAY($result_main)) {
//* DEBUG: */ echo __LINE__.'/'.$main_cnt.'/'.$content['action'].'/'.$sub_what.':'.getWhat()."*<br />\n";
// Init variables
- $GLOBALS['block_mode'] = false;
+ enableBlockMode(false);
$act = $content['action'];
// Load menu header template
- LOAD_TEMPLATE($mode."_menu_title", false, $content);
+ LOAD_TEMPLATE($mode . '_menu_title', false, $content);
// Sub menu
$result_sub = SQL_QUERY_ESC("SELECT title AS sub_title, what AS sub_what FROM `{!_MYSQL_PREFIX!}_%s_menu` WHERE `action`='%s' AND `what` != '' AND `what` IS NOT NULL ".$AND." ORDER BY `sort`",
}
} else {
// This is a menu block... ;-)
- $GLOBALS['block_mode'] = true;
+ enableBlockMode();
$INC_BLOCK = sprintf("inc/modules/%s/action-%s.php", $mode, $content['action']);
if (isFileReadable($INC_BLOCK)) {
// Load include file
return $isset;
}
+// Enables block-mode
+function enableBlockMode ($enabled = true) {
+ $GLOBALS['block_mode'] = $enabled;
+}
+
+// Checks wether block-mode is enabled
+function isBlockModeEnabled () {
+ // Abort if not set
+ if (!isset($GLOBALS['block_mode'])) {
+ // Needs to be fixed
+ debug_report_bug(__FUNCTION__ . ': block_mode is not set.');
+ } // END - if
+
+ // Return it
+ return $GLOBALS['block_mode'];
+}
+
// [EOF]
?>