You are here

protected function WizardPluginBase::default_display_sorts in Views (for Drupal 7) 8.3

Retrieves all sort information used by the default display.

Additional to the one provided by the plugin this method takes care about adding additional sorts based on user input.

Parameters

array $form: The full wizard form array.

array $form_state: The current state of the wizard form.

Return value

array An array of sort arrays keyed by ID. A sort array contains the options accepted by a sort handler.

1 call to WizardPluginBase::default_display_sorts()
WizardPluginBase::build_display_options in lib/Drupal/views/Plugin/views/wizard/WizardPluginBase.php
Builds an array of display options for the view.

File

lib/Drupal/views/Plugin/views/wizard/WizardPluginBase.php, line 799
Definition of Drupal\views\Plugin\views\wizard\WizardPluginBase.

Class

WizardPluginBase
Provides the interface and base class for Views Wizard plugins.

Namespace

Drupal\views\Plugin\views\wizard

Code

protected function default_display_sorts($form, $form_state) {
  $sorts = array();

  // Add any sorts provided by the plugin.
  foreach ($this
    ->getSorts() as $name => $info) {
    $sorts[$name] = $info;
  }

  // Add any sorts specified by the user when filling out the wizard.
  $sorts = array_merge($sorts, $this
    ->default_display_sorts_user($form, $form_state));
  return $sorts;
}