API16

JHtmlAccess/assetgroups

From Joomla! Documentation

< 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[edit]

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


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

Syntax[edit]

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

Returns[edit]

mixed An array or false if an error occurs

Defined in[edit]

libraries/joomla/html/html/access.php

Importing[edit]

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

Source Body[edit]

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[edit]

Code Examples[edit]