You are here

function views_plugin_display_page::validate in Views (for Drupal 7) 6.3

Same name and namespace in other branches
  1. 6.2 plugins/views_plugin_display_page.inc \views_plugin_display_page::validate()
  2. 7.3 plugins/views_plugin_display_page.inc \views_plugin_display_page::validate()

Make sure the display and all associated handlers are valid.

Return value

Empty array if the display is valid; an array of error strings if it is not.

Overrides views_plugin_display::validate

File

plugins/views_plugin_display_page.inc, line 524
Contains the page display plugin.

Class

views_plugin_display_page
The plugin that handles a full page.

Code

function validate() {
  $errors = parent::validate();
  $menu = $this
    ->get_option('menu');
  if (!empty($menu['type']) && $menu['type'] != 'none' && empty($menu['title'])) {
    $errors[] = t('Display @display is set to use a menu but the menu title is not set.', array(
      '@display' => $this->display->display_title,
    ));
  }
  if ($menu['type'] == 'default tab') {
    $tab_options = $this
      ->get_option('tab_options');
    if (!empty($tab_options['type']) && $tab_options['type'] != 'none' && empty($tab_options['title'])) {
      $errors[] = t('Display @display is set to use a parent menu but the parent menu title is not set.', array(
        '@display' => $this->display->display_title,
      ));
    }
  }
  return $errors;
}