You are here

function views_deploy_add_form_validate in Deploy - Content Staging 5

Same name and namespace in other branches
  1. 6 modules/views_deploy/views_deploy.pages.inc \views_deploy_add_form_validate()

deploy view form validation callback

File

views_deploy/views_deploy.module, line 94

Code

function views_deploy_add_form_validate($form_id, $form_values) {
  foreach ($form_values['view_name'] as $view_name) {
    $result = db_query("select * from {deploy_plan_items} where module = 'views' and pid = %d and data = '%s'", $form_values['pid'], $view_name);
    if (db_num_rows($result)) {
      form_set_error('view_name', t("View {$view_name} already exists in the deployment plan."));
    }
  }
}