You are here

function trigger_assign in Drupal 6

Same name and namespace in other branches
  1. 7 modules/trigger/trigger.admin.inc \trigger_assign()

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 modules/trigger/trigger.module
Implementation of hook_menu().

File

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;
}