File manager - Edit - /home/jardides/www/Jardi-design/components/com_sitemap/models/sitemap.php
Back
<?php /** * * @author SDIC SA * @package Sitemap * @version 2.0 * @copyright Copyright (C) 2015 SDIC SA * @license GNU GPLv2 * @link https://www.sdic.ch * */ // No direct access defined( '_JEXEC' ) or die( 'Restricted access' ); jimport( 'joomla.application.component.model' ); class SiteMapModelSiteMap extends JModelLegacy{ function listNav( $menuType = 'mainmenu' ){ $db = JFactory::getDBO(); $access = " AND `access` = 1 "; $db = JFactory::getDBO(); $query = "SELECT `id`, `title`, `link`, `path`, `params`, `level`, `access`, `type` FROM `#__menu` WHERE `menutype` = '".$menuType."' AND `published` = '1' AND `parent_id` = 1 AND `level` = 1 $access ORDER by `lft` ASC, `id` ASC"; $db->setQuery($query); $rootNav = $db->loadObjectList(); $navs = Array(); foreach ($rootNav as $nav){ $nav->level=+1; $navs[]=$nav; $kids = $this->kidsNav( $menuType, $nav->id, $navs); } return $navs; } function kidsNav( $menutype, $parent, &$output ){ $db = JFactory::getDBO(); $menu = " AND menutype = '$menutype'"; $query="SELECT `id`, `title`, `link`, `path`, `params`, `level`, `access`,`type` FROM `#__menu` WHERE `parent_id` = '$parent' AND `published` = '1'$menu ORDER by `lft`"; $db->setQuery($query); $subNav = $db->loadObjectList(); foreach($subNav as $sub){ $output[]=$sub; $sublev=$sub->level; $this->kidsNav( $menutype, $sub->id, $output); } } function getNav( $menuId = 0 ){ if( empty($menuId) ){ return null; } $result = null; $db = JFactory::getDBO(); $db = JFactory::getDBO(); $query = "SELECT `id`, `title`, `link`, `path`, `params`, `level`, `access`, `type` FROM `#__menu` WHERE `id` = ".$menuId; $db->setQuery($query); $result = $db->loadObject(); return $result; } }
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Generation time: 0.01 |
proxy
|
phpinfo
|
Settings