trigger_assign_form_validate

Versions
6 – 7
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.

Code

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

<?php
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.'));
    }
  }
}
?>
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.