actions_function_lookup

Versions
6 – 7
actions_function_lookup($hash)

Given an md5 hash of an action array key, returns the key (function or ID).

Faster than actions_actions_map() when you only need the function name or ID.

Parameters

$hash MD5 hash of a function name or action ID array key. The array key is a key into the return value of actions_list() (array key is the action function name) or actions_get_all_actions() (array key is the action ID).

Return value

The corresponding array key, or FALSE if no match is found.

▾ 6 functions call actions_function_lookup()

system_actions_configure_submit in modules/system/system.admin.inc
Process system_actions_configure() form submissions.
system_actions_configure_validate in modules/system/system.admin.inc
Validate system_actions_configure() form submissions.
trigger_assign_form_submit in modules/trigger/trigger.admin.inc
Submit function for trigger_assign_form().
trigger_assign_form_validate in modules/trigger/trigger.admin.inc
Validation function for trigger_assign_form().
trigger_unassign in modules/trigger/trigger.admin.inc
Confirm removal of an assigned action.
trigger_unassign_submit in modules/trigger/trigger.admin.inc
Submit callback for trigger_unassign() form.

Code

includes/actions.inc, line 228

<?php
function actions_function_lookup($hash) {
  // Check for a function name match.
  $actions_list = actions_list();
  foreach ($actions_list as $function => $array) {
    if (md5($function) == $hash) {
      return $function;
    }
  }

  // Must be a configurable action; check database.
  return db_query("SELECT aid FROM {actions} WHERE MD5(aid) = :hash AND parameters <> ''", array(':hash' => $hash))->fetchField();
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.