--- actions.inc	2008-01-15 23:25:58.559000000 -0500
+++ actions.f.inc	2008-01-15 23:36:00.749000000 -0500
@@ -1,6 +1,7 @@
 <?php
 // $Id: actions.inc,v 1.8 2007/12/31 14:51:04 goba Exp $
 
+
 /**
  * @file
  * This is the actions engine for executing stored actions.
@@ -46,9 +47,9 @@
     watchdog('actions', 'Stack overflow: too many calls to actions_do(). Aborting to prevent infinite recursion.', WATCHDOG_ERROR);
     return;
   }
-  $actions = array();
+  $actions           = array();
   $available_actions = actions_list();
-  $result = array();
+  $result            = array();
   if (is_array($action_ids)) {
     $where = array();
     $where_values = array();
@@ -61,7 +62,7 @@
         $actions[$action_id] = $available_actions[$action_id];
       }
     }
-
+    
     // When we have action instances we must go to the database to
     // retrieve instance data.
     if ($where) {
@@ -75,12 +76,13 @@
         $actions[$action->aid]['type'] = $action->type;
       }
     }
-
+    
     // Fire actions, in no particular order.
     foreach ($actions as $action_id => $params) {
-      if (is_numeric($action_id)) { // Configurable actions need parameters.
-        $function = $params['callback'];
-        $context = array_merge($context, $params);
+      // Configurable actions need parameters.
+      if (is_numeric($action_id)) {
+        $function           = $params['callback'];
+        $context            = array_merge($context, $params);
         $result[$action_id] = $function($object, $context, $a1, $a2);
       }
       // Singleton action; $action_id is the function name.
@@ -93,9 +95,9 @@
   else {
     // If it's a configurable action, retrieve stored parameters.
     if (is_numeric($action_ids)) {
-      $action = db_fetch_object(db_query("SELECT * FROM {actions} WHERE aid = %d", $action_ids));
-      $function = $action->callback;
-      $context = array_merge($context, unserialize($action->parameters));
+      $action              = db_fetch_object(db_query("SELECT * FROM {actions} WHERE aid = %d", $action_ids));
+      $function            = $action->callback;
+      $context             = array_merge($context, unserialize($action->parameters));
       $result[$action_ids] = $function($object, $context, $a1, $a2);
     }
     // Singleton action; $action_ids is the function name.
@@ -106,7 +108,6 @@
   return $result;
 }
 
-
 /**
  * Discover all action functions by invoking hook_action_info().
  *
@@ -157,7 +158,7 @@
     $actions = module_invoke_all('action_info');
     drupal_alter('action_info', $actions);
   }
-
+  
   // See module_implements for explanations of this cast.
   return (array)$actions;
 }
@@ -210,9 +211,9 @@
   $actions_map = array();
   foreach ($actions as $callback => $array) {
     $key = md5($callback);
-    $actions_map[$key]['callback']     = isset($array['callback']) ? $array['callback'] : $callback;
-    $actions_map[$key]['description']  = $array['description'];
-    $actions_map[$key]['type']         = $array['type'];
+    $actions_map[$key]['callback'] = isset($array['callback']) ? $array['callback'] : $callback;
+    $actions_map[$key]['description'] = $array['description'];
+    $actions_map[$key]['type'] = $array['type'];
     $actions_map[$key]['configurable'] = $array['configurable'];
   }
   return $actions_map;
@@ -236,7 +237,7 @@
       return $function;
     }
   }
-
+  
   // Must be an instance; must check database.
   $aid = db_result(db_query("SELECT aid FROM {actions} WHERE MD5(aid) = '%s' AND parameters != ''", $hash));
   return $aid;
@@ -259,7 +260,7 @@
   while ($action = db_fetch_object($result)) {
     $actions_in_db[$action->callback] = array('aid' => $action->aid, 'description' => $action->description);
   }
-
+  
   // Go through all the actions provided by modules.
   foreach ($actions_in_code as $callback => $array) {
     // Ignore configurable actions since their instances get put in
@@ -276,19 +277,19 @@
       }
     }
   }
-
+  
   // Any actions that we have left in $actions_in_db are orphaned.
   if ($actions_in_db) {
     $orphaned = array();
     $placeholder = array();
-
+    
     foreach ($actions_in_db as $callback => $array) {
       $orphaned[] = $callback;
       $placeholder[] = "'%s'";
     }
-
+    
     $orphans = implode(', ', $orphaned);
-
+    
     if ($delete_orphans) {
       $placeholders = implode(', ', $placeholder);
       $results = db_query("SELECT a.aid, a.description FROM {actions} a WHERE callback IN ($placeholders)", $orphaned);
@@ -336,7 +337,7 @@
     db_query("INSERT INTO {actions} (aid, callback, type, parameters, description) VALUES (%d, '%s', '%s', '%s', '%s')", $aid, $function, $type, $serialized, $desc);
     watchdog('actions', 'Action %action created.', array('%action' => $desc));
   }
-
+  
   return $aid;
 }
 
@@ -363,3 +364,4 @@
   db_query("DELETE FROM {actions} WHERE aid = %d", $aid);
   module_invoke_all('actions_delete', $aid);
 }
+
