Commit fae4f5e9 authored by dawehner's avatar dawehner Committed by tim.plunkett
Browse files

Issue #1760188 by dawehner: Improve Wizard method default_display_options().

parent 7e367707
......@@ -636,7 +636,7 @@ protected function instantiate_view($form, &$form_state) {
*/
protected function build_display_options($form, $form_state) {
// Display: Master
$display_options['default'] = $this->default_display_options($form, $form_state);
$display_options['default'] = $this->default_display_options();
$display_options['default'] += array(
'filters' => array(),
'sorts' => array(),
......@@ -715,10 +715,14 @@ protected function add_displays($view, $display_options, $form, $form_state) {
/**
* Assembles the default display options for the view.
*
* Most subclasses will need to override this method to provide some fields
* Most wizards will need to override this method to provide some fields
* or a different row plugin.
*
* @return array
* Returns an array of display options, which are used in
* ViewDisplay::$display_options.
*/
protected function default_display_options($form, $form_state) {
protected function default_display_options() {
$display_options = array();
$display_options['access']['type'] = 'none';
$display_options['cache']['type'] = 'none';
......
......@@ -124,8 +124,11 @@ protected function display_options_row(&$display_options, $row_plugin, $row_opt
}
}
protected function default_display_options($form, $form_state) {
$display_options = parent::default_display_options($form, $form_state);
/**
* Overrides Drupal\views\Plugin\views\wizard\WizardPluginBase::default_display_options().
*/
protected function default_display_options() {
$display_options = parent::default_display_options();
// Add permission-based access control.
$display_options['access']['type'] = 'perm';
......
......@@ -39,8 +39,11 @@ class File extends WizardPluginBase {
'file_download_path' => TRUE
);
protected function default_display_options($form, $form_state) {
$display_options = parent::default_display_options($form, $form_state);
/**
* Overrides Drupal\views\Plugin\views\wizard\WizardPluginBase::default_display_options().
*/
protected function default_display_options() {
$display_options = parent::default_display_options();
// Add permission-based access control.
$display_options['access']['type'] = 'perm';
......
......@@ -119,10 +119,10 @@ protected function build_form_style(&$form, &$form_state, $type) {
}
/**
* @override
* Overrides Drupal\views\Plugin\views\wizard\WizardPluginBase::default_display_options().
*/
protected function default_display_options($form, $form_state) {
$display_options = parent::default_display_options($form, $form_state);
protected function default_display_options() {
$display_options = parent::default_display_options();
// Add permission-based access control.
$display_options['access']['type'] = 'perm';
......
......@@ -80,8 +80,11 @@ protected function row_style_options($type) {
return $options;
}
protected function default_display_options($form, $form_state) {
$display_options = parent::default_display_options($form, $form_state);
/**
* Overrides Drupal\views\Plugin\views\wizard\WizardPluginBase::default_display_options().
*/
protected function default_display_options() {
$display_options = parent::default_display_options();
// Add permission-based access control.
$display_options['access']['type'] = 'perm';
......
......@@ -37,8 +37,11 @@ class TaxonomyTerm extends WizardPluginBase {
)
);
protected function default_display_options($form, $form_state) {
$display_options = parent::default_display_options($form, $form_state);
/**
* Overrides Drupal\views\Plugin\views\wizard\WizardPluginBase::default_display_options().
*/
protected function default_display_options() {
$display_options = parent::default_display_options();
// Add permission-based access control.
$display_options['access']['type'] = 'perm';
......
......@@ -58,8 +58,11 @@ class Users extends WizardPluginBase {
)
);
protected function default_display_options($form, $form_state) {
$display_options = parent::default_display_options($form, $form_state);
/**
* Overrides Drupal\views\Plugin\views\wizard\WizardPluginBase::default_display_options().
*/
protected function default_display_options() {
$display_options = parent::default_display_options();
// Add permission-based access control.
$display_options['access']['type'] = 'perm';
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment