function trigger_unassign_submit

Form submission handler for trigger_unassign().

File

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

Code

function trigger_unassign_submit($form, &$form_state) {
    if ($form_state['values']['confirm'] == 1) {
        $aid = actions_function_lookup($form_state['values']['aid']);
        db_delete('trigger_assignments')->condition('hook', $form_state['values']['hook'])
            ->condition('aid', $aid)
            ->execute();
        drupal_static_reset('trigger_get_assigned_actions');
        $actions = actions_get_all_actions();
        watchdog('actions', 'Action %action has been unassigned.', array(
            '%action' => $actions[$aid]['label'],
        ));
        drupal_set_message(t('Action %action has been unassigned.', array(
            '%action' => $actions[$aid]['label'],
        )));
        $form_state['redirect'] = 'admin/structure/trigger/' . $form_state['values']['module'];
    }
    else {
        drupal_goto('admin/structure/trigger');
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.