Same name and namespace in other branches
  1. 7.x-3.x includes/quicktabs_style_plugin.inc \quicktabs_style_plugin::validate()

File

includes/quicktabs_style_plugin.inc, line 64

Class

quicktabs_style_plugin
Style plugin to display Quicktabs.

Code

function validate() {
    $errors = parent::validate();
    // Ensure that we're using the field row style.
    if (!$this->row_plugin
        ->uses_fields()) {
        $errors[] = t('Display "@display" uses the "@style" row style, but the Quicktabs display style requires use of the "Fields" row style.', array(
            '@display' => $this->display->display_title,
            '@style' => $this->row_plugin->definition['title'],
        ));
    }
    // Ensure that a valid tab title field is selected.
    $fields = $this->display->handler
        ->get_handlers('field');
    if (empty($this->options['tab_title_field']) || !isset($fields[$this->options['tab_title_field']])) {
        $errors[] = t('The Quicktabs display style requires that a field be configured to be used as the tab title.');
    }
    return $errors;
}