Index: render.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/render/render.module,v
retrieving revision 1.1.2.4
diff -u -p -r1.1.2.4 render.module
--- render.module	19 Jan 2008 03:45:42 -0000	1.1.2.4
+++ render.module	9 Apr 2008 20:57:57 -0000
@@ -613,12 +613,13 @@ function render_get_fonts($plugin = NULL
  *   An array of rules.
  */
 function render_get_rules($plugin = NULL) {
+  static $active_plugins = array();
   static $rules = array();
-  
-  if (!empty($rules)) {
-    return $rules;
+
+  if (isset($plugin) && isset($rules[$plugin])) {
+    return $rules[$plugin];
   }
-  
+
   if (isset($plugin)) {
     $result = db_query("SELECT * FROM {render} WHERE plugin = '%s' ORDER BY weight", check_plain($plugin));
   }
@@ -630,16 +631,20 @@ function render_get_rules($plugin = NULL
     $properties = unserialize($rule['properties']);
     $rule = array_merge($rule, $properties);
     
-    $rules[$rule['rid']] = $rule;
+    $rules[$rule['plugin']][$rule['rid']] = $rule;
   }
 
-  // Store active plugins in a variable.
-  $active_plugins = array();
-  foreach ($rules as $rule) {
-    $active_plugins[$rule['plugin']] = $rule['plugin'];
+  if (!isset($plugin)) {
+    // Store all active plugins in a variable.
+    foreach ($rules as $rule) {
+      $active_plugins[$rule['plugin']] = $rule['plugin'];
+    }
+    variable_set('render_plugins', $active_plugins);
   }
-  variable_set('render_plugins', $active_plugins);
   
+  if (isset($plugin)) {
+    return isset($rules[$plugin]) ? $rules[$plugin] : array();
+  }
   return $rules;
 }
 
