You are here

function icon_bundle_overview_form_validate in Icon API 7

Same name and namespace in other branches
  1. 8 includes/admin.inc \icon_bundle_overview_form_validate()

Validate callback for 'icon_bundle_overview_form'.

File

includes/admin.inc, line 91
admin.inc Provides administrative callbacks and tasks.

Code

function icon_bundle_overview_form_validate($form, $form_state) {

  // Ensure only authorized users can submit the form.
  if (!user_access('administer icons')) {
    form_set_error('', t('You are not authorized to submit this form.'));
  }
  $view_path_alias = $form_state['values']['icon_api_view_path_alias'];
  if ($form['global']['icon_api_view_path_alias']['#default_value'] !== $form_state['values']['icon_api_view_path_alias'] && menu_get_item($view_path_alias)) {
    form_set_error('icon_api_view_path_alias', t('The view path alias provided, "%url", is already in use. Please enter a different path.', array(
      '%url' => $view_path_alias,
    )));
  }
}