+// Prepares the filter array for usage
+function prepareFilterArray () {
+ // Abort here if array is absend (e.g. not cached)
+ if (!isset($GLOBALS['cache_array']['filter']['filter_name'])) {
+ // Abort silently
+ return false;
+ } // END - if
+
+ // Init dummy array
+ $filterArray = array(
+ 'chains' => array(),
+ 'loaded' => array(),
+ 'counter' => array()
+ );
+
+ // Found in cache so rewrite the array
+ foreach ($GLOBALS['cache_array']['filter']['filter_name'] as $idx => $filterName) {
+ // Get filter function
+ $filterFunction = $GLOBALS['cache_array']['filter']['filter_function'][$idx];
+
+ // Add the element with mapped index
+ $filterArray['counter'][$filterName][$filterFunction] = $GLOBALS['cache_array']['filter']['filter_counter'][$idx];
+ $filterArray['loaded'][$filterName][$filterFunction] = true;
+ $filterArray['chains'][$filterName][$filterFunction] = $GLOBALS['cache_array']['filter']['filter_active'][$idx];
+ } // END - foreach
+
+ // Remove the cache
+ $GLOBALS['cache_array']['filter'] = $filterArray;
+}
+