trigger_unassign

Versions
6
trigger_unassign($form_state, $hook = NULL, $op = NULL, $aid = NULL)
7
trigger_unassign($form, $form_state, $module, $hook = NULL, $aid = NULL)

Confirm removal of an assigned action.

See also

trigger_unassign_submit()

Parameters

$module The tab of triggers the user will be directed to after successful removal of the action, or if the confirmation form is cancelled.

$hook

$aid The action ID.

Related topics

Code

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

<?php
function trigger_unassign($form, $form_state, $module, $hook = NULL, $aid = NULL) {
  if (!($hook && $aid)) {
    drupal_goto('admin/structure/trigger');
  }

  $form['hook'] = array(
    '#type' => 'value',
    '#value' => $hook,
  );
  $form['module'] = array(
    '#type' => 'value',
    '#value' => $module,
  );
  $form['aid'] = array(
    '#type' => 'value',
    '#value' => $aid,
  );

  $action = actions_function_lookup($aid);
  $actions = actions_get_all_actions();

  $destination = 'admin/structure/trigger/' . $module;

  return confirm_form($form,
    t('Are you sure you want to unassign the action %title?', array('%title' => $actions[$action]['label'])),
    $destination,
    t('You can assign it again later if you wish.'),
    t('Unassign'), t('Cancel')
  );
}
?>
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.