Skip to content

Commit

Permalink
Add layout to content Associations helper
Browse files Browse the repository at this point in the history
  • Loading branch information
Septdir committed Apr 23, 2018
1 parent 9152025 commit 6f6eced
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions components/com_content/helpers/association.php
Expand Up @@ -23,17 +23,19 @@ abstract class ContentHelperAssociation extends CategoryHelperAssociation
/**
* Method to get the associations for a given item
*
* @param integer $id Id of the item
* @param string $view Name of the view
* @param integer $id Id of the item
* @param string $view Name of the view
* @param string $layout View layout
*
* @return array Array of associations for the item
*
* @since 3.0
*/
public static function getAssociations($id = 0, $view = null)
public static function getAssociations($id = 0, $view = null, $layout = null)
{
$jinput = JFactory::getApplication()->input;
$view = $view === null ? $jinput->get('view') : $view;
$layout = $layout === null ? $jinput->get('view', '', 'string') : $view;
$id = empty($id) ? $jinput->getInt('id') : $id;
$user = JFactory::getUser();
$groups = implode(',', $user->getAuthorisedViewLevels());
Expand Down Expand Up @@ -65,7 +67,7 @@ public static function getAssociations($id = 0, $view = null)

if ($result > 0)
{
$return[$tag] = ContentHelperRoute::getArticleRoute($item->id, (int) $item->catid, $item->language);
$return[$tag] = ContentHelperRoute::getArticleRoute($item->id, (int) $item->catid, $item->language, $layout);
}
}
}
Expand Down

0 comments on commit 6f6eced

Please sign in to comment.