trigger_options

Versions
6
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.

Code

modules/trigger/trigger.module, line 413

<?php
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];
  }
}
?>
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.