function quiz_action_options in Quiz 6.4
Same name and namespace in other branches
- 6.6 quiz.module \quiz_action_options()
- 6.3 quiz.module \quiz_action_options()
- 6.5 quiz.module \quiz_action_options()
- 7.6 quiz.module \quiz_action_options()
- 7 quiz.module \quiz_action_options()
- 7.4 quiz.module \quiz_action_options()
This function was copied from the triggers module as to prevent having to be dependent on that module for the actions to work. The trigger function is called trigger_options().
Parameters
$type: One of 'node', 'user', 'comment'.
Return value
Array keyed by action ID.
1 call to quiz_action_options()
- quiz_form in ./
quiz.module - Implementation of hook_form().
File
- ./
quiz.module, line 3630 - Quiz Module
Code
function quiz_action_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 {
$options[$type][0] = t('Choose an action');
// Lets sort it to get the choose an action back first.
ksort($options[$type]);
return $options[$type];
}
}