API16

JHtmlAccess/assetgroups

< API16:JHtmlAccess

The "API16" namespace is an archived namespace. This page contains information for a Joomla! version which is no longer supported. It exists only as a historical reference, it will not be improved and its content may be incomplete and/or contain broken links.

Description

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


<! 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 transcluded page call, red link never existed >

Examples

Code Examples


Advertisement