// Rewrite module cache
$modArray = $GLOBALS['cache_array']['modules'];
foreach ($modArray['module'] as $key => $mod) {
- $GLOBALS['cache_array']['modules']['id'][$mod] = $modArray['id'][$key];
- unset($GLOBALS['cache_array']['modules']['id'][$key]);
- $GLOBALS['cache_array']['modules']['title'][$mod] = $modArray['title'][$key];
- unset($GLOBALS['cache_array']['modules']['title'][$key]);
- $GLOBALS['cache_array']['modules']['locked'][$mod] = $modArray['locked'][$key];
- unset($GLOBALS['cache_array']['modules']['locked'][$key]);
- $GLOBALS['cache_array']['modules']['hidden'][$mod] = $modArray['hidden'][$key];
- unset($GLOBALS['cache_array']['modules']['hidden'][$key]);
- $GLOBALS['cache_array']['modules']['admin_only'][$mod] = $modArray['admin_only'][$key];
- unset($GLOBALS['cache_array']['modules']['admin_only'][$key]);
- $GLOBALS['cache_array']['modules']['mem_only'][$mod] = $modArray['mem_only'][$key];
- unset($GLOBALS['cache_array']['modules']['mem_only'][$key]);
- if (isset($GLOBALS['cache_array']['modules']['has_menu'][$key])) {
- $GLOBALS['cache_array']['modules']['has_menu'][$mod] = $modArray['has_menu'][$key];
- unset($GLOBALS['cache_array']['modules']['has_menu'][$key]);
- } // END - if
+ // Add all
+ foreach (array('id','title','locked','hidden','admin_only','mem_only','has_menu') as $entry) {
+ // Is the entry set?
+ if (isset($GLOBALS['cache_array']['modules'][$entry][$key])) {
+ // Transfer it
+ $GLOBALS['cache_array']['modules'][$entry][$mod] = $modArray[$entry][$key];
+
+ // And delete cache
+ unset($GLOBALS['cache_array']['modules'][$entry][$key]);
+ } else {
+ // Log this for debug purposes
+ debugLogMessage('[' . basename(__FILE__) . ':' . __LINE__ . '] Entry not found. module=' . $mod . ',key=' . $key . ',entry=' . $entry);
+ }
+ } // END - foreach
} // END - foreach
unset($modArray);
} elseif (getOutputMode() != 1) {