You are here

public function ExcelExport::defineOptions in Excel Serialization 8

Same name in this branch
  1. 8 src/Plugin/views/display/ExcelExport.php \Drupal\xls_serialization\Plugin\views\display\ExcelExport::defineOptions()
  2. 8 src/Plugin/views/style/ExcelExport.php \Drupal\xls_serialization\Plugin\views\style\ExcelExport::defineOptions()

Information about options for all kinds of purposes will be held here.


'option_name' => array(
 - 'default' => default value,
 - 'contains' => (optional) array of items this contains, with its own
     defaults, etc. If contains is set, the default will be ignored and
     assumed to be array().
 ),

Return value

array Returns the options of this handler/plugin.

Overrides Serializer::defineOptions

File

src/Plugin/views/style/ExcelExport.php, line 51

Class

ExcelExport
A style plugin for Excel export views.

Namespace

Drupal\xls_serialization\Plugin\views\style

Code

public function defineOptions() {
  $options = parent::defineOptions();
  $options['xls_settings']['contains'] = [
    'xls_format' => [
      'default' => 'Excel2007',
    ],
  ];
  $options['xls_settings']['metadata']['contains'] = [
    // The 'created' and 'modified' elements are not exposed here, as they
    // default to the current time (that the spreadsheet is created), and
    // would probably just confuse the UI.
    'creator' => [
      'default' => '',
    ],
    'last_modified_by' => [
      'default' => '',
    ],
    'title' => [
      'default' => '',
    ],
    'description' => [
      'default' => '',
    ],
    'subject' => [
      'default' => '',
    ],
    'keywords' => [
      'default' => '',
    ],
    'category' => [
      'default' => '',
    ],
    'manager' => [
      'default' => '',
    ],
    'company' => [
      'default' => '',
    ],
  ];
  return $options;
}