function trigger_assign
7.x trigger.admin.inc | trigger_assign( |
6.x trigger.admin.inc | trigger_assign($type = NULL) |
Build the form that allows users to assign actions to hooks.
Parameters
$type: Name of hook.
Return value
HTML form.
1 string reference to 'trigger_assign'
- trigger_menu in drupal-6.x/
modules/ trigger/ trigger.module - Implementation of hook_menu().
File
- drupal-6.x/
modules/ trigger/ trigger.admin.inc, line 16 - Admin page callbacks for the trigger module.
Code
function trigger_assign($type = NULL) {
// If no type is specified we default to node actions, since they
// are the most common.
if (!isset($type)) {
drupal_goto('admin/build/trigger/node');
}
if ($type == 'node') {
$type = 'nodeapi';
}
$output = '';
$hooks = module_invoke_all('hook_info');
foreach ($hooks as $module => $hook) {
if (isset($hook[$type])) {
foreach ($hook[$type] as $op => $description) {
$form_id = 'trigger_' . $type . '_' . $op . '_assign_form';
$output .= drupal_get_form($form_id, $type, $op, $description['runs when']);
}
}
}
return $output;
}