Actions

API16

JHtmlAccess/assetgroups

From Joomla! Documentation

< API16:JHtmlAccess
Replacement filing cabinet.png
This Namespace has been archived - Please Do Not Edit or Create Pages in this namespace. Pages contain information for a Joomla! version which is no longer supported. It exists only as a historical reference, will not be improved and its content may be incomplete.

Contents

Description

Gets a list of the asset groups as an array of JHtml compatible options.

[<! removed edit link to red link >]

<! removed transcluded page call, red link never existed >

Syntax

static assetgroups($config=array())
Parameter Name Default Value Description
$config array() $config An array of options for the options

Returns

mixed An array or false if an error occurs

Defined in

libraries/joomla/html/html/access.php

Importing

jimport( 'joomla.html.html.access' );

Source Body

public static function assetgroups($config = array())
{
        if (empty(JHtmlAccess::$asset_groups)) {
                $db             = &JFactory::getDbo();
                $query  = $db->getQuery(true);
 
                $query->select('a.id AS value, a.title AS text');
                $query->from('#__viewlevels AS a');
                $query->group('a.id');
                $query->order('a.ordering ASC');
 
                $db->setQuery($query);
                JHtmlAccess::$asset_groups = $db->loadObjectList();
 
                // Check for a database error.
                if ($db->getErrorNum()) {
                        JError::raiseNotice(500, $db->getErrorMsg());
                        return false;
                }
        }
 
        return JHtmlAccess::$asset_groups;
}

[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >

Examples

<CodeExamplesForm />