summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwebchick2013-12-04 05:25:33 (GMT)
committerwebchick2013-12-04 05:25:33 (GMT)
commit68a8646283f41b75757cc0263fab828c7dcf90ab (patch)
tree79e3bf425dac4fa714c4c1adbc608f15323a6ae0
parent2f49630d965e63c0a40ee5c9d2cfccf2929f9539 (diff)
Issue #2072593 by stevepurkiss, legolasbo, deneo: Remove Unused local variable from /core/modules/views/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php.
-rw-r--r--core/modules/views/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php29
1 files changed, 13 insertions, 16 deletions
diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php b/core/modules/views/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php
index 754e428..4faffc7 100644
--- a/core/modules/views/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php
+++ b/core/modules/views/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php
@@ -224,7 +224,7 @@ abstract class DisplayPluginBase extends PluginBase {
public function usesExposed() {
if (!isset($this->has_exposed)) {
foreach ($this->handlers as $type => $value) {
- foreach ($this->view->$type as $id => $handler) {
+ foreach ($this->view->$type as $handler) {
if ($handler->canExpose() && $handler->isExposed()) {
// one is all we need; if we find it, return true.
$this->has_exposed = TRUE;
@@ -373,7 +373,7 @@ abstract class DisplayPluginBase extends PluginBase {
}
if (!empty($this->view->argument) && $this->getOption('hide_attachment_summary')) {
- foreach ($this->view->argument as $argument_id => $argument) {
+ foreach ($this->view->argument as $argument) {
if ($argument->needsStylePlugin() && empty($argument->argument_validated)) {
return FALSE;
}
@@ -1030,17 +1030,17 @@ abstract class DisplayPluginBase extends PluginBase {
if (!empty($this->view->build_info['substitutions'])) {
$tokens = $this->view->build_info['substitutions'];
}
- $count = 0;
- foreach ($this->view->display_handler->getHandlers('argument') as $arg => $handler) {
- $token = '%' . ++$count;
- if (!isset($tokens[$token])) {
- $tokens[$token] = '';
- }
- // Use strip tags as there should never be HTML in the path.
- // However, we need to preserve special characters like " that
- // were removed by check_plain().
- $tokens['!' . $count] = isset($this->view->args[$count - 1]) ? strip_tags(decode_entities($this->view->args[$count - 1])) : '';
+ // Add tokens for every argument (contextual filter) and path arg.
+ $handlers = count($this->view->display_handler->getHandlers('argument'));
+ for ($count = 1; $count <= $handlers; $count++) {
+ if (!isset($tokens["%$count"])) {
+ $tokens["%$count"] = '';
+ }
+ // Use strip tags as there should never be HTML in the path.
+ // However, we need to preserve special characters like " that
+ // were removed by check_plain().
+ $tokens["!$count"] = isset($this->view->args[$count - 1]) ? strip_tags(decode_entities($this->view->args[$count - 1])) : '';
}
return $tokens;
@@ -1129,8 +1129,6 @@ abstract class DisplayPluginBase extends PluginBase {
$style_summary = empty($style_plugin_instance->definition['title']) ? t('Missing style plugin') : $style_plugin_instance->summaryTitle();
$style_title = empty($style_plugin_instance->definition['title']) ? t('Missing style plugin') : $style_plugin_instance->pluginTitle();
- $style = '';
-
$options['style'] = array(
'category' => 'format',
'title' => t('Format'),
@@ -1715,7 +1713,7 @@ abstract class DisplayPluginBase extends PluginBase {
$options = array();
$count = 0; // This lets us prepare the key as we want it printed.
- foreach ($this->view->display_handler->getHandlers('argument') as $arg => $handler) {
+ foreach ($this->view->display_handler->getHandlers('argument') as $handler) {
$options[t('Arguments')]['%' . ++$count] = t('@argument title', array('@argument' => $handler->adminLabel()));
$options[t('Arguments')]['!' . $count] = t('@argument input', array('@argument' => $handler->adminLabel()));
}
@@ -2073,7 +2071,6 @@ abstract class DisplayPluginBase extends PluginBase {
$registry = $this->theme_registry;
$extension = $this->theme_extension;
- $output = '';
$picked = FALSE;
foreach ($themes as $theme) {
$template = strtr($theme, '_', '-') . $extension;