public static function getTopDocumentsRoute($categoryId = 0, $fetchAllSubCat = 1, $orderType, $canonical = false, $isRss = false, $layout = '') { if (!$categoryId) { $categoryId = JUDownloadFrontHelperCategory::getRootCategory()->id; } $link = 'index.php?option=com_judownload&view=topdocuments'; $link .= '&id=' . $categoryId; $link .= '&all=' . $fetchAllSubCat; $link .= '&ordertype=' . $orderType; if ($canonical) { $itemId = JUDownloadHelperRoute::findItemIdOfCategory($categoryId); if (!$itemId) { $itemId = JUDownloadHelperRoute::getHomeMenuItemId(); } } else { $itemId = JUDownloadHelperRoute::findItemIdOfCategory($categoryId); } if ($layout && $layout != 'default') { $link .= '&layout=' . $layout; } if ($itemId) { $link .= "&Itemid=" . $itemId; } if ($isRss) { $link .= "&format=feed"; } return $link; }