You are here

function views_plugin_display_system::options_validate in Administration Views 6

Same name and namespace in other branches
  1. 7 plugins/views_plugin_display_system.inc \views_plugin_display_system::options_validate()

File

plugins/views_plugin_display_system.inc, line 182
System display plugin.

Class

views_plugin_display_system
Plugin to handle replacement of existing system paths.

Code

function options_validate(&$form, &$form_state) {
  parent::options_validate($form, $form_state);
  switch ($form_state['section']) {
    case 'path':
      if (strpos($form_state['values']['path'], '%') === 0) {
        form_error($form['path'], t('"%" may not be used for the first segment of a path.'));
      }

      // Automatically remove '/' from path.
      $form_state['values']['path'] = trim($form_state['values']['path'], '/');
      break;
  }
}