Skip to content

Commit

Permalink
Merge branch 'staging' into deprecate-psr0
Browse files Browse the repository at this point in the history
  • Loading branch information
laoneo committed Jan 22, 2017
2 parents eb7a0ea + b222a8d commit 5d561b2
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions components/com_tags/views/tag/view.html.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,9 @@ public function display($tpl = null)
$active = $app->getMenu()->getActive();
$temp = clone $this->params;

// Convert item params to a Registry object
$item[0]->params = new Registry($item[0]->params);

// Check to see which parameters should take priority
if ($active)
{
Expand All @@ -140,9 +143,9 @@ public function display($tpl = null)
// If the current view is the active item and an tag view for one tag, then the menu item params take priority
if (strpos($currentLink, 'view=tag') && strpos($currentLink, '&id[0]=' . (string) $item[0]->id))
{
// $item->params are the article params, $temp are the menu item params
// $item[0]->params are the tag params, $temp are the menu item params
// Merge so that the menu item params take priority
$this->params->merge($temp);
$item[0]->params->merge($temp);

// Load layout from active query (in case it is an alternative menu item)
if (isset($active->query['layout']))
Expand All @@ -152,14 +155,14 @@ public function display($tpl = null)
}
else
{
// Current view is not tags, so the global params take priority since tags is not an item.
// Merge the menu item params with the global params so that the article params take priority
$temp->merge($this->state->params);
$this->params = $temp;
// Current menuitem is not a single tag view, so the tag params take priority.
// Merge the menu item params with the tag params so that the tag params take priority
$temp->merge($item[0]->params);
$item[0]->params = $temp;

// Check for alternative layouts (since we are not in a single-article menu item)
// Single-article menu item layout takes priority over alt layout for an article
if ($layout = $this->params->get('tags_layout'))
if ($layout = $item[0]->params->get('tag_layout'))
{
$this->setLayout($layout);
}
Expand Down

0 comments on commit 5d561b2

Please sign in to comment.