]> git.mxchange.org Git - mailer.git/blobdiff - inc/loader/load_cache-modules.php
Removed comment introduced by Profi-Concept, this comment should fine (in a much...
[mailer.git] / inc / loader / load_cache-modules.php
index 9058039183cba2c02feaca55974541e8dc4a3eb5..64a99d3f8bb9f82fcf6446952396e1679edc7aab 100644 (file)
@@ -14,8 +14,6 @@
  * $Date::                                                            $ *
  * $Tag:: 0.2.1-FINAL                                                 $ *
  * $Author::                                                          $ *
- * Needs to be in all Files and every File needs "svn propset           *
- * svn:keywords Date Revision" (autoprobset!) at least!!!!!!            *
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
  * Copyright (c) 2009, 2010 by Mailer Developer Team                    *
@@ -52,26 +50,41 @@ if (($GLOBALS['cache_instance']->loadCacheFile('modules')) && ($GLOBALS['cache_i
 
        // Rewrite module cache
        $modArray = $GLOBALS['cache_array']['modules'];
+
+       // Do only process valid arrays
+       if (!isset($modArray['module'])) {
+               // We should fix this!
+               debug_report_bug(__FILE__, __LINE__, 'modArray=<pre>'.print_r($modArray, true).'</pre>');
+       } // END - if
+
+       // Rewrite some parts
        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]);
+               // Default without sql_patches
+               $entries = array('id','title','locked','hidden','admin_only','mem_only');
+
+               // Is ext-sql_patches newer or equal 0.3.6?
+               if (isExtensionInstalledAndNewer('sql_patches', '0.3.6')) {
+                       // Add 'has_menu'
+                       $entries[] = 'has_menu';
                } // END - if
+
+               // Add all
+               foreach ($entries 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
+                               logDebugMessage(basename(__FILE__), __LINE__, 'Entry not found. module=' . $mod . ',key=' . $key . ',entry=' . $entry);
+                       }
+               } // END - foreach
        } // END - foreach
        unset($modArray);
-} elseif (getOutputMode() != 1) {
+} elseif (isHtmlOutputMode()) {
        // Create cache file here
        $GLOBALS['cache_instance']->init();