function trigger_options

6.x trigger.module trigger_options($type = 'all')

Often we generate a select field of all actions. This function generates the options for that select.

Parameters

$type: One of 'node', 'user', 'comment'.

Return value

Array keyed by action ID.

File

drupal-6.x/modules/trigger/trigger.module, line 414
Enables functions to be stored and executed at a later time when triggered by other modules or by one of Drupal's core API hooks.

Code

function trigger_options($type = 'all') {
  $options = array(t('Choose an action'));
  foreach (actions_actions_map(actions_get_all_actions()) as $aid => $action) {
    $options[$action['type']][$aid] = $action['description'];
  }

  if ($type == 'all') {
    return $options;
  }
  else {
    return $options[$type];
  }
}