You are here

function trigger_assign_form_validate in Drupal 6

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

Validation function for trigger_assign_form().

Makes sure that the user is not re-assigning an action to an event.

1 string reference to 'trigger_assign_form_validate'
trigger_assign_form in modules/trigger/trigger.admin.inc
Create the form definition for assigning an action to a hook-op combination.

File

modules/trigger/trigger.admin.inc, line 186
Admin page callbacks for the trigger module.

Code

function trigger_assign_form_validate($form, $form_state) {
  $form_values = $form_state['values'];
  if (!empty($form_values['aid'])) {
    $aid = actions_function_lookup($form_values['aid']);
    if (db_result(db_query("SELECT aid FROM {trigger_assignments} WHERE hook = '%s' AND op = '%s' AND aid = '%s'", $form_values['hook'], $form_values['operation'], $aid))) {
      form_set_error($form_values['operation'], t('The action you chose is already assigned to that trigger.'));
    }
  }
}