trigger_assign_form_validate

function trigger_assign_form_validate

trigger_assign_form_validate($form, $form_state)

Form validation handler for trigger_assign_form().

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

See also

trigger_assign_form_submit()

File

modules/trigger/trigger.admin.inc, line 212
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']);
    $aid_exists = db_query("SELECT aid FROM {trigger_assignments} WHERE hook = :hook AND aid = :aid", array(
      ':hook' => $form_values['hook'],
      ':aid' => $aid,
    ))->fetchField();
    if ($aid_exists) {
      form_set_error($form_values['hook'], t('The action you chose is already assigned to that trigger.'));
    }
  }
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!trigger!trigger.admin.inc/function/trigger_assign_form_validate/7.x

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部