You are here

public function Page::defaultableSections in Views PDF 8

Lists the 'defaultable' sections and what items each section contains.

Overrides DisplayPluginBase::defaultableSections

File

src/Plugin/views/display/Page.php, line 41
Contains \Drupal\views_pdf\Plugin\views\display\Page.

Class

Page
This class contains all the functionality of the PDF display.

Namespace

Drupal\views_pdf\Plugin\views\display

Code

public function defaultableSections($section = NULL) {
  if (in_array($section, [
    'style_options',
    'style_plugin',
    'row_options',
    'row_plugin',
  ])) {
    return FALSE;
  }
  $sections = parent::defaultableSections($section);

  // Tell views our sitename_title option belongs in the title section.
  if ($section === 'title') {
    $sections[] = 'sitename_title';
  }
  elseif (!$section) {
    $sections['title'][] = 'sitename_title';
  }
  return $sections;
}