]> git.mxchange.org Git - mailer.git/blobdiff - inc/loader/load-payments.php
Renamed more templates
[mailer.git] / inc / loader / load-payments.php
index c11c58f63f11391e85e8d20d47763e0f9952baaa..6a6ce9d68c4134ab718591fce2640b92a0293a24 100644 (file)
 if (!defined('__SECURITY')) {
        die();
 } elseif (isInstallationPhase()) {
-       // Use this code if you don't want to run this cache loader on installation phase
-       return;
+       // Do not run in installation phase
+       return FALSE;
 }
 
 // Let's start with the admins table...
 if (($GLOBALS['cache_instance']->loadCacheFile('payments')) && ($GLOBALS['cache_instance']->extensionVersionMatches('payments'))) {
        // Load cache
        $GLOBALS['cache_array']['payments'] = $GLOBALS['cache_instance']->getArrayFromCache();
-} elseif (isHtmlOutputMode()) {
+
+       // Init temporary array
+       $paymentsData = array();
+
+       // Rewrite all to id
+       foreach ($GLOBALS['cache_array']['payments']['id'] as $key => $id) {
+               // Re-add key with id
+               foreach ($GLOBALS['cache_array']['payments'] as $key2 => $array) {
+                       // Is key2 not 'id'?
+                       if ($key2 != 'id') {
+                               // Then Add it
+                               $paymentsData[$id][$key2] = $GLOBALS['cache_array']['payments'][$key2][$key];
+                       } // END - if
+               } // END - foreach
+       } // END - foreach
+
+       // Set the array back and remove temporary
+       $GLOBALS['cache_array']['payments'] = $paymentsData;
+       unset($paymentsData);
+} elseif ((isHtmlOutputMode()) || (isRawOutputMode())) {
        // Create cache file
        $GLOBALS['cache_instance']->init();