function trigger_assign_form_validate

7.x trigger.admin.inc trigger_assign_form_validate($form, $form_state)
6.x trigger.admin.inc trigger_assign_form_validate($form, $form_state)

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 drupal-6.x/modules/trigger/trigger.admin.inc
Create the form definition for assigning an action to a hook-op combination.

File

drupal-6.x/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.'));
    }
  }
}