// Check if cache is latest version
if (GET_EXT_VERSION("cache") >= "0.1.2") {
+ // Is the cache there?
+ if (!isset($GLOBALS['cache_array']['modules'])) {
+ // This should normally not happen...
+ debug_report_bug("Cache 'modules' is gone.");
+ } // END - if
+
// Is the module cached?
if (isset($GLOBALS['cache_array']['modules']['locked'][$mod_chk])) {
// Check cache
while (list($main_title, $main_action) = SQL_FETCHROW($result_main)) {
//* DEBUG: */ echo __LINE__."/".$main_cnt."/".$main_action."/".$sub_what.":".$GLOBALS['what']."*<br />\n";
// Init variables
- $BLOCK_MODE = false; $act = $main_action;
+ $GLOBALS['block_mode'] = false; $act = $main_action;
// Prepare content
$content = array(
}
} else {
// This is a menu block... ;-)
- $BLOCK_MODE = true;
+ $GLOBALS['block_mode'] = true;
$INC_BLOCK = sprintf("inc/modules/%s/action-%s.php", $MODE, $main_action);
if (FILE_READABLE($INC_BLOCK)) {
// Load include file
$GLOBALS['sqls'] = (array) $SQLs;
}
+// Remover for SQLs array
+function UNSET_SQLS () {
+ unset($GLOBALS['sqls']);
+}
+
// Getter for SQLs array
function GET_SQLS () {
return $GLOBALS['sqls'];
// Add an SQL to the list
function ADD_SQL ($sql) {
+ //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, sprintf("sql=%s, count=%d", $sql, COUNT_SQLS()));
$GLOBALS['sqls'][] = (string) $sql;
}
if (IS_SQLS_INITIALIZED()) {
// Then count it
$count = count($GLOBALS['sqls']);
+ //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, sprintf("count=%d", $count));
} // END - if
// Return it
function IS_SQLS_VALID () {
return (
(IS_SQLS_INITIALIZED()) &&
- (COUNT_SQLS() > 0) &&
- (!empty($GLOBALS['sqls'][0]))
+ (COUNT_SQLS() > 0)
);
}