Source for file helper.php
Documentation is available at helper.php
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
* Get a list of the menu items.
* @param JRegistry $params The module options.
public static function getList(&$params)
$base =
self::getBase($params);
$levels =
$user->getAuthorisedViewLevels();
$key =
'menu_items' .
$params .
implode(',', $levels) .
'.' .
$base->id;
if (!($items =
$cache->get($key)))
$start = (int)
$params->get('startLevel');
$end = (int)
$params->get('endLevel');
$showAll =
$params->get('showAllChildren');
$items =
$menu->getItems('menutype', $params->get('menutype'));
foreach ($items as $i =>
$item)
if (($start &&
$start >
$item->level)
||
($end &&
$item->level >
$end)
||
(!$showAll &&
$item->level >
1 &&
!in_array($item->parent_id, $path))
||
($start >
1 &&
!in_array($item->tree[$start -
2], $path)))
$item->shallower =
false;
if (isset
($items[$lastitem]))
$items[$lastitem]->deeper =
($item->level >
$items[$lastitem]->level);
$items[$lastitem]->shallower =
($item->level <
$items[$lastitem]->level);
$items[$lastitem]->level_diff =
($items[$lastitem]->level -
$item->level);
$item->parent = (boolean)
$menu->getItems('parent_id', (int)
$item->id, true);
$item->flink =
$item->link;
// Reverted back for CMS version 2.5.6
// No further action needed.
if ((strpos($item->link, 'index.php?') ===
0) &&
(strpos($item->link, 'Itemid=') ===
false))
// If this is an internal Joomla link, ensure the Itemid is set.
$item->flink =
$item->link .
'&Itemid=' .
$item->id;
// If this is an alias use the item id stored in the parameters to make the link.
$item->flink =
'index.php?Itemid=' .
$item->params->get('aliasoptions');
$router =
$app::getRouter();
if ($router->getMode() ==
JROUTER_MODE_SEF)
$item->flink =
'index.php?Itemid=' .
$item->id;
$item->flink .=
'&Itemid=' .
$item->id;
$item->flink =
JRoute::_($item->flink, true, $item->params->get('secure'));
$item->flink =
JRoute::_($item->flink);
// We prevent the double encoding because for some reason the $item is shared for menu modules and we get double encoding
// when the cause of that is found the argument should be removed
$item->anchor_css =
htmlspecialchars($item->params->get('menu-anchor_css', ''), ENT_COMPAT, 'UTF-8', false);
$item->anchor_title =
htmlspecialchars($item->params->get('menu-anchor_title', ''), ENT_COMPAT, 'UTF-8', false);
$item->menu_image =
$item->params->get('menu_image', '') ?
htmlspecialchars($item->params->get('menu_image', ''), ENT_COMPAT, 'UTF-8', false) :
'';
if (isset
($items[$lastitem]))
$items[$lastitem]->deeper =
(($start?
$start:
1) >
$items[$lastitem]->level);
$items[$lastitem]->shallower =
(($start?
$start:
1) <
$items[$lastitem]->level);
$items[$lastitem]->level_diff =
($items[$lastitem]->level -
($start?
$start:
1));
$cache->store($items, $key);
* @param JRegistry $params The module options.
public static function getBase(&$params)
// Get base menu item from parameters
if ($params->get('base'))
// Use active menu item if no base found
$base =
self::getActive($params);
* @param JRegistry $params The module options.
return $menu->getActive() ?
$menu->getActive() :
$menu->getDefault();
Documentation generated on Tue, 19 Nov 2013 15:04:17 +0100 by phpDocumentor 1.4.3