actions_function_lookup

Definition

actions_function_lookup($hash)
includes/actions.inc, line 231

Description

Given an md5 hash of a function name, return the function name.

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

Parameters

$hash MD5 hash of a function name

Return value

Function name

Code

<?php
function actions_function_lookup($hash) {
  $actions_list = actions_list();
  foreach ($actions_list as $function => $array) {
    if (md5($function) == $hash) {
      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;
}
?>
 
 

Drupal is a registered trademark of Dries Buytaert.