From 6f6ecedf968f36ad07a914b03dee3377c3a011a2 Mon Sep 17 00:00:00 2001 From: Septdir Date: Mon, 23 Apr 2018 17:16:50 +0300 Subject: [PATCH] Add layout to content Associations helper --- components/com_content/helpers/association.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/components/com_content/helpers/association.php b/components/com_content/helpers/association.php index 462dc0593fcb9..780bb0e9bacf7 100644 --- a/components/com_content/helpers/association.php +++ b/components/com_content/helpers/association.php @@ -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()); @@ -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); } } }