[ Index ] |
PHP Cross Reference of Joomla 4.2.2 documentation |
[Summary view] [Print] [Text view]
1 <?php 2 3 /** 4 * @package Joomla.Site 5 * @subpackage com_newsfeeds 6 * 7 * @copyright (C) 2017 Open Source Matters, Inc. <https://www.joomla.org> 8 * @license GNU General Public License version 2 or later; see LICENSE.txt 9 */ 10 11 namespace Joomla\Component\Newsfeeds\Site\Helper; 12 13 use Joomla\CMS\Categories\CategoryNode; 14 use Joomla\CMS\Language\Multilanguage; 15 16 // phpcs:disable PSR1.Files.SideEffects 17 \defined('_JEXEC') or die; 18 // phpcs:enable PSR1.Files.SideEffects 19 20 /** 21 * Newsfeeds Component Route Helper 22 * 23 * @since 1.5 24 */ 25 abstract class RouteHelper 26 { 27 /** 28 * getNewsfeedRoute 29 * 30 * @param int $id menu itemid 31 * @param int $catid category id 32 * @param int $language language 33 * 34 * @return string 35 */ 36 public static function getNewsfeedRoute($id, $catid, $language = 0) 37 { 38 // Create the link 39 $link = 'index.php?option=com_newsfeeds&view=newsfeed&id=' . $id; 40 41 if ((int) $catid > 1) { 42 $link .= '&catid=' . $catid; 43 } 44 45 if ($language && $language !== '*' && Multilanguage::isEnabled()) { 46 $link .= '&lang=' . $language; 47 } 48 49 return $link; 50 } 51 52 /** 53 * getCategoryRoute 54 * 55 * @param int $catid category id 56 * @param int $language language 57 * 58 * @return string 59 */ 60 public static function getCategoryRoute($catid, $language = 0) 61 { 62 if ($catid instanceof CategoryNode) { 63 $id = $catid->id; 64 } else { 65 $id = (int) $catid; 66 } 67 68 if ($id < 1) { 69 $link = ''; 70 } else { 71 // Create the link 72 $link = 'index.php?option=com_newsfeeds&view=category&id=' . $id; 73 74 if ($language && $language !== '*' && Multilanguage::isEnabled()) { 75 $link .= '&lang=' . $language; 76 } 77 } 78 79 return $link; 80 } 81 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Wed Sep 7 05:41:13 2022 | Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer |