You are here

protected function ArgumentPluginBase::defaultActions in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/modules/views/src/Plugin/views/argument/ArgumentPluginBase.php \Drupal\views\Plugin\views\argument\ArgumentPluginBase::defaultActions()

Provide a list of default behaviors for this argument if the argument is not present.

Override this method to provide additional (or fewer) default behaviors.

9 calls to ArgumentPluginBase::defaultActions()
ArgumentPluginBase::buildOptionsForm in core/modules/views/src/Plugin/views/argument/ArgumentPluginBase.php
Provide a form to edit options for this plugin.
ArgumentPluginBase::defaultAction in core/modules/views/src/Plugin/views/argument/ArgumentPluginBase.php
Handle the default action, which means our argument wasn't present.
ArgumentPluginBase::hasDefaultArgument in core/modules/views/src/Plugin/views/argument/ArgumentPluginBase.php
Determine if the argument is set to provide a default argument.
ArgumentPluginBase::needsStylePlugin in core/modules/views/src/Plugin/views/argument/ArgumentPluginBase.php
Determine if the argument needs a style plugin.
ArgumentPluginBase::validateFail in core/modules/views/src/Plugin/views/argument/ArgumentPluginBase.php
How to act if validation fails.

... See full list

3 methods override ArgumentPluginBase::defaultActions()
IndexTidDepth::defaultActions in core/modules/taxonomy/src/Plugin/views/argument/IndexTidDepth.php
Override defaultActions() to remove summary actions.
NullArgument::defaultActions in core/modules/views/src/Plugin/views/argument/NullArgument.php
Override defaultActions() to remove actions that don't make sense for a null argument.
UserUid::defaultActions in core/modules/comment/src/Plugin/views/argument/UserUid.php
Provide a list of default behaviors for this argument if the argument is not present.

File

core/modules/views/src/Plugin/views/argument/ArgumentPluginBase.php, line 495
Contains \Drupal\views\Plugin\views\argument\ArgumentPluginBase.

Class

ArgumentPluginBase
Base class for argument (contextual filter) handler plugins.

Namespace

Drupal\views\Plugin\views\argument

Code

protected function defaultActions($which = NULL) {
  $defaults = array(
    'ignore' => array(
      'title' => $this
        ->t('Display all results for the specified field'),
      'method' => 'defaultIgnore',
    ),
    'default' => array(
      'title' => $this
        ->t('Provide default value'),
      'method' => 'defaultDefault',
      'form method' => 'defaultArgumentForm',
      'has default argument' => TRUE,
      'default only' => TRUE,
    ),
    'not found' => array(
      'title' => $this
        ->t('Hide view'),
      'method' => 'defaultNotFound',
      'hard fail' => TRUE,
    ),
    'summary' => array(
      'title' => $this
        ->t('Display a summary'),
      'method' => 'defaultSummary',
      'form method' => 'defaultSummaryForm',
      'style plugin' => TRUE,
    ),
    'empty' => array(
      'title' => $this
        ->t('Display contents of "No results found"'),
      'method' => 'defaultEmpty',
    ),
    'access denied' => array(
      'title' => $this
        ->t('Display "Access Denied"'),
      'method' => 'defaultAccessDenied',
    ),
  );
  if ($this->view->display_handler
    ->hasPath()) {
    $defaults['not found']['title'] = $this
      ->t('Show "Page not found"');
  }
  if ($which) {
    if (!empty($defaults[$which])) {
      return $defaults[$which];
    }
  }
  else {
    return $defaults;
  }
}