public static function getTopCommentsRoute($canonical = false, $layout = '') { $link = 'index.php?option=com_judownload&view=topcomments'; if ($canonical) { $itemIdTreeRoot = JUDownloadHelperRoute::getMenuItemIdOfViewCategoryTreeRoot(); if ($itemIdTreeRoot > 0) { $itemId = $itemIdTreeRoot; } else { $itemId = JUDownloadHelperRoute::getHomeMenuItemId(); } } else { $itemId = JUDownloadHelperRoute::findItemIdByViewName('topcomments'); } if ($layout && $layout != 'default') { $link .= '&layout=' . $layout; } if ($itemId) { $link .= "&Itemid=" . $itemId; } return $link; }