You are here

function views_pdf_plugin_display::options_summary in Views PDF 7.3

Same name and namespace in other branches
  1. 6 views_pdf_plugin_display.inc \views_pdf_plugin_display::options_summary()
  2. 7 views_pdf_plugin_display.inc \views_pdf_plugin_display::options_summary()
  3. 7.2 plugins/views_pdf_plugin_display.inc \views_pdf_plugin_display::options_summary()

Provide a summary of the options.

Overrides views_plugin_display_page::options_summary

File

./views_pdf_plugin_display.inc, line 567
PDF display plugin.

Class

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

Code

function options_summary(&$categories, &$options) {
  parent::options_summary($categories, $options);
  $fonts = views_pdf_get_font_list();

  // Change Page title:
  $categories['page'] = array(
    'title' => t('PDF settings'),
    'column' => 'second',
    'build' => array(
      '#weight' => -10,
    ),
  );

  // Add for attach the display to others:
  $displays = array_filter($this
    ->get_option('displays'));
  if (count($displays) > 1) {
    $attach_to = t('Multiple displays');
  }
  elseif (count($displays) == 1) {
    $display = array_shift($displays);
    if (!empty($this->view->display[$display])) {
      $attach_to = check_plain($this->view->display[$display]->display_title);
    }
  }
  if (!isset($attach_to)) {
    $attach_to = t('None');
  }
  $options['displays'] = array(
    'category' => 'page',
    'title' => t('Attach to'),
    'value' => $attach_to,
  );

  // Add for pdf page settings
  $options['pdf_page'] = array(
    'category' => 'page',
    'title' => t('PDF Page Settings'),
    'value' => $this
      ->get_option('default_page_format'),
    'desc' => t('Define some PDF specific settings.'),
  );

  // Add for pdf font settings
  $options['pdf_fonts'] = array(
    'category' => 'page',
    'title' => t('PDF Fonts Settings'),
    'value' => t('!family at !size pt', array(
      '!family' => $fonts[$this
        ->get_option('default_font_family')],
      '!size' => $this
        ->get_option('default_font_size'),
    )),
    'desc' => t('Define some PDF specific settings.'),
  );

  // Add for pdf header/footer settings
  $options['pdf_header'] = array(
    'category' => 'page',
    'title' => t('PDF Header & Footer'),
    'value' => t('Settings'),
    'desc' => t('Define PDF settings for header & footer.'),
  );

  // add for pdf template settings
  if (!empty($this
    ->get_option('leading_template')) || !empty($this
    ->get_option('template')) || !empty($this
    ->get_option('succeed_template'))) {
    $isAnyTemplate = t('Yes');
  }
  else {
    $isAnyTemplate = t('No');
  }
  $options['pdf_template'] = array(
    'category' => 'page',
    'title' => t('PDF Template Settings'),
    'value' => $isAnyTemplate,
    'desc' => t('Define some PDF specific settings.'),
  );
  if ($this
    ->get_option('css_file') == '') {
    $css_file = t('None');
  }
  else {
    $css_file = $this
      ->get_option('css_file');
  }
  $options['css'] = array(
    'category' => 'page',
    'title' => t('CSS File'),
    'value' => $css_file,
    'desc' => t('Define a CSS file attached to all HTML output.'),
  );
}