function action_actions_map

Creates an associative array keyed by hashes of function names or IDs.

Hashes are used to prevent actual function names from going out into HTML forms and coming back.

Parameters

$actions: An associative array with function names or action IDs as keys and associative arrays with keys 'label', 'type', etc. as values. This is usually the output of action_list() or action_get_all_actions().

Return value

An associative array whose keys are hashes of the input array keys, and whose corresponding values are associative arrays with components 'callback', 'label', 'type', and 'configurable' from the input array.

2 calls to action_actions_map()
action_admin_configure in drupal/core/modules/action/action.admin.inc
Form constructor for the configuration of a single action.
action_admin_manage in drupal/core/modules/action/action.admin.inc
Menu callback; Displays an overview of available and configured actions.

File

drupal/core/modules/action/action.module, line 298
This is the Actions module for executing stored actions.

Code

function action_actions_map($actions) {
  $actions_map = array();
  foreach ($actions as $callback => $array) {
    $key = drupal_hash_base64($callback);
    $actions_map[$key]['callback'] = isset($array['callback']) ? $array['callback'] : $callback;
    $actions_map[$key]['label'] = $array['label'];
    $actions_map[$key]['type'] = $array['type'];
    $actions_map[$key]['configurable'] = $array['configurable'];
  }
  return $actions_map;
}