[fusionregistry-commitlog] SF.net SVN: fusionregistry: [37] branches/stable_3_0_x/upload/sources/
                
                Brought to you by:
                
                    copland007
                    
                
            
            
        
        
        
    | 
      
      
      From: SVN c. <fus...@li...> - 2008-02-12 05:01:46
      
     | 
| Revision: 37
          http://fusionregistry.svn.sourceforge.net/fusionregistry/?rev=37&view=rev
Author:   copland007
Date:     2008-02-11 21:01:50 -0800 (Mon, 11 Feb 2008)
Log Message:
-----------
Added registry_categories to cache support.
Modified Paths:
--------------
    branches/stable_3_0_x/upload/sources/components_acp/fusionscripts/fusionregistry/ad_categories.php
    branches/stable_3_0_x/upload/sources/components_acp/fusionscripts/fusionregistry/ad_tools.php
Modified: branches/stable_3_0_x/upload/sources/components_acp/fusionscripts/fusionregistry/ad_categories.php
===================================================================
--- branches/stable_3_0_x/upload/sources/components_acp/fusionscripts/fusionregistry/ad_categories.php	2008-02-11 07:39:45 UTC (rev 36)
+++ branches/stable_3_0_x/upload/sources/components_acp/fusionscripts/fusionregistry/ad_categories.php	2008-02-12 05:01:50 UTC (rev 37)
@@ -383,5 +383,29 @@
         // End of the show, c'ya
         $this->ipsclass->admin->redirect( $url, $text, 0, $time );
     }
+
+
+    /**
+     * Update/Rebuild cache
+     *
+     * This gets run any time a change is made and on demand in the ACP tools.
+     */
+    function update_cache()
+    {
+        // Start with an empty cache
+        $this->ipsclass->cache['registry_categories'] = array();
+
+        $this->ipsclass->DB->simple_construct( array( 'select' => 'id,title', 'from' => 'registry_categories' ) );
+        $this->ipsclass->DB->simple_exec();
+
+        // Loop through each setting
+        while ( $row = $this->ipsclass->DB->fetch_row() )
+        {
+            $this->ipsclass->cache['registry_categories'][ $row['id'] ] = $row['title'];
+        }
+
+        // Save it back to the cache_store
+		$this->ipsclass->update_cache( array( 'name' => 'registry_categories', 'array' => 1, 'deletefirst' => 1, 'donow' => 0 ) );
+    }
 }
 ?>
\ No newline at end of file
Modified: branches/stable_3_0_x/upload/sources/components_acp/fusionscripts/fusionregistry/ad_tools.php
===================================================================
--- branches/stable_3_0_x/upload/sources/components_acp/fusionscripts/fusionregistry/ad_tools.php	2008-02-11 07:39:45 UTC (rev 36)
+++ branches/stable_3_0_x/upload/sources/components_acp/fusionscripts/fusionregistry/ad_tools.php	2008-02-12 05:01:50 UTC (rev 37)
@@ -101,6 +101,7 @@
                             'registry_config'      => 'Runtime configuration',
                             'registry_field_defs'  => 'Custom field definitions',
                             'registry_rating_defs' => 'Custom rating definitions',
+                            'registry_categories'  => 'Modification categories',
                           );
 
         switch($this->ipsclass->input['code'])
@@ -480,6 +481,15 @@
                 $this->ipsclass->main_msg = 'Registry custom field cache updated';
                 break;
 
+            case 'registry_categories':
+                require_once( AD_REGISTRY_PATH.'ad_categories.php' );
+                $this->fr_cache = new ad_registry_categories();
+                $this->fr_cache->ipsclass =& $this->ipsclass;
+
+                $this->fr_cache->update_cache();
+                $this->ipsclass->main_msg = 'Registry modification category cache updated';
+                break;
+
             default:
                 $this->ipsclass->main_msg = 'No valid cache was specified to update';
                 break;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 |