trigger_assign

Versions
6
trigger_assign($type = NULL)
7
trigger_assign($module_to_display = NULL)

Builds the form that allows users to assign actions to triggers.

Parameters

$module_to_display Which tab of triggers to display. E.g., 'node' for all node-related triggers.

Return value

HTML form.

Code

modules/trigger/trigger.admin.inc, line 17

<?php
function trigger_assign($module_to_display = NULL) {
  // If no type is specified we default to node actions, since they
  // are the most common.
  if (!isset($module_to_display)) {
    drupal_goto('admin/structure/trigger/node');
  }

  $build = array();
  $trigger_info = module_invoke_all('trigger_info');
  drupal_alter('trigger_info', $trigger_info);
  foreach ($trigger_info as $module => $hooks) {
    if ($module == $module_to_display) {
      foreach ($hooks as $hook => $description) {
        $form_id = 'trigger_' . $hook . '_assign_form';
        $build[$form_id] = drupal_get_form($form_id, $module, $hook, $description['label']);
      }
    }
  }
  return $build;
}
?>
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.