You are here

function dynamic_banner_admin_form_validate in Dynamic Banner 6

Same name and namespace in other branches
  1. 7.2 dynamic_banner.module \dynamic_banner_admin_form_validate()
  2. 7 includes/callbacks.inc \dynamic_banner_admin_form_validate()
  3. 8.x dynamic_banner.module \dynamic_banner_admin_form_validate()

Verify that the Banner is valid

File

includes/callbacks.inc, line 216
Dynamic Banner Admin Pages and various other functions to make them work Most of the code in this file was derived from path module

Code

function dynamic_banner_admin_form_validate($form, &$form_state) {
  $path = $form_state['values']['path'];

  // we are updating so let it make the changes (aka ignore path collisions)
  if (isset($form_state['values']['dbid'])) {
    return;
  }

  // check for db path collisions
  if (db_result(db_query("SELECT COUNT(path) FROM {dynamic_banner} WHERE path = '%s'", $path))) {
    form_set_error('path', t('The path %path is already in use.', array(
      '%path' => $path,
    )));
  }
}