}
}
-
$this->setOptionDefaults($this->options, $this->defineOptions());
$this->display = &$display;
/**
* {@inheritdoc}
*/
- public function isDefaultDisplay() { return FALSE; }
+ public function isDefaultDisplay() {
+ return FALSE;
+ }
/**
* {@inheritdoc}
/**
* {@inheritdoc}
*/
- public function attachTo(ViewExecutable $view, $display_id, array &$build) { }
+ public function attachTo(ViewExecutable $view, $display_id, array &$build) {}
/**
* {@inheritdoc}
/**
* {@inheritdoc}
*/
- public function hasPath() { return FALSE; }
+ public function hasPath() {
+ return FALSE;
+ }
/**
* {@inheritdoc}
*/
- public function usesLinkDisplay() { return !$this->hasPath(); }
+ public function usesLinkDisplay() {
+ return !$this->hasPath();
+ }
/**
* {@inheritdoc}
*/
- public function usesExposedFormInBlock() { return $this->hasPath(); }
+ public function usesExposedFormInBlock() {
+ return $this->hasPath();
+ }
/**
* {@inheritdoc}
return $this->default_display->getOption($option);
}
- if (array_key_exists($option, $this->options)) {
+ if (isset($this->options[$option]) || array_key_exists($option, $this->options)) {
return $this->options[$option];
}
}
'#title' => $this->t('Show contextual links'),
'#default_value' => $this->getOption('show_admin_links'),
];
- break;
+ break;
case 'use_more':
$form['#title'] .= $this->t('Add a more link to the bottom of the display.');
$form['use_more'] = [
if (preg_match('/[^a-zA-Z0-9-_ ]/', $css_class)) {
$form_state->setError($form['css_class'], $this->t('CSS classes must be alphanumeric or dashes only.'));
}
- break;
+ break;
case 'display_id':
if ($form_state->getValue('display_id')) {
if (preg_match('/[^a-z0-9_]/', $form_state->getValue('display_id'))) {
/**
* {@inheritdoc}
*/
- public function renderFilters() { }
+ public function renderFilters() {}
/**
* {@inheritdoc}
'#cache' => &$this->view->element['#cache'],
];
- $this->applyDisplayCachablityMetadata($this->view->element);
+ $this->applyDisplayCacheabilityMetadata($this->view->element);
return $element;
}
* @param array $element
* The render array with updated cacheability metadata.
*/
- protected function applyDisplayCachablityMetadata(array &$element) {
+ protected function applyDisplayCacheabilityMetadata(array &$element) {
/** @var \Drupal\views\Plugin\views\cache\CachePluginBase $cache */
$cache = $this->getPlugin('cache');
->applyTo($element);
}
+ /**
+ * Applies the cacheability of the current display to the given render array.
+ *
+ * @param array $element
+ * The render array with updated cacheability metadata.
+ *
+ * @deprecated in Drupal 8.4.0, will be removed before Drupal 9.0. Use
+ * DisplayPluginBase::applyDisplayCacheabilityMetadata instead.
+ *
+ * @see \Drupal\views\Plugin\views\display\DisplayPluginBase::applyDisplayCacheabilityMetadata()
+ */
+ protected function applyDisplayCachablityMetadata(array &$element) {
+ @trigger_error('The DisplayPluginBase::applyDisplayCachablityMetadata method is deprecated since version 8.4 and will be removed in 9.0. Use DisplayPluginBase::applyDisplayCacheabilityMetadata instead.', E_USER_DEPRECATED);
+ $this->applyDisplayCacheabilityMetadata($element);
+ }
+
/**
* {@inheritdoc}
*/
/**
* {@inheritdoc}
*/
- public function execute() { }
+ public function execute() {}
/**
* {@inheritdoc}
// of cacheability metadata (e.g.: cache contexts), so they can bubble up.
// Thus, we add the cacheability metadata first, then modify / remove the
// cache keys depending on the $cache argument.
- $this->applyDisplayCachablityMetadata($this->view->element);
+ $this->applyDisplayCacheabilityMetadata($this->view->element);
if ($cache) {
$this->view->element['#cache'] += ['keys' => []];
// Places like \Drupal\views\ViewExecutable::setCurrentPage() set up an