Source for file helper.php
Documentation is available at helper.php
* @package Joomla.Administrator
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
* @package Joomla.Administrator
* Get a list of the available menus.
* @return array An array of the available menus (from the menu types table).
$query =
$db->getQuery(true)
->select('a.*, SUM(b.home) AS home')
->from('#__menu_types AS a')
->join('LEFT', '#__menu AS b ON b.menutype = a.menutype AND b.home != 0')
->join('LEFT', '#__languages AS l ON l.lang_code = language')
->select('l.title_native')
->where('(b.client_id = 0 OR b.client_id IS NULL)');
$query->group('a.id, a.menutype, a.description, a.title, b.menutype,b.language,l.image,l.sef,l.title_native');
$result =
$db->loadObjectList();
* Get a list of the authorised, non-special components to display in the components menu.
* @param boolean $authCheck An optional switch to turn off the auth check (to support custom layouts 'grey out' behaviour).
* @return array A nest array of component objects and submenus
$query =
$db->getQuery(true);
$query->select('m.id, m.title, m.alias, m.link, m.parent_id, m.img, e.element')
// Filter on the enabled states.
$query->join('LEFT', '#__extensions AS e ON m.component_id = e.extension_id')
->where('m.client_id = 1')
$components =
$db->loadObjectList();
// Parse the list of extensions.
foreach ($components as &$component)
$component->link =
trim($component->link);
if ($component->parent_id ==
1)
// Only add this top level if it is authorised and enabled.
if ($authCheck ==
false ||
($authCheck &&
$user->authorise('core.manage', $component->element)))
$result[$component->id] =
$component;
if (!isset
($result[$component->id]->submenu))
$result[$component->id]->submenu =
array();
// If the root menu link is empty, add it in.
if (empty($component->link))
$component->link =
'index.php?option=' .
$component->element;
if (!empty($component->element))
// Load the core file then
// Load extension-local file.
$lang->load($component->element .
'.sys', JPATH_BASE, null, false, true)
||
$lang->load($component->element .
'.sys', JPATH_ADMINISTRATOR .
'/components/' .
$component->element, null, false, true);
$component->text =
$lang->hasKey($component->title) ?
JText::_($component->title) :
$component->alias;
if (isset
($result[$component->parent_id]))
// Add the submenu link if it is defined.
if (isset
($result[$component->parent_id]->submenu) &&
!empty($component->link))
$component->text =
$lang->hasKey($component->title) ?
JText::_($component->title) :
$component->alias;
$result[$component->parent_id]->submenu[] =
&$component;
Documentation generated on Tue, 19 Nov 2013 15:04:27 +0100 by phpDocumentor 1.4.3