/content/code/trunk/administrator/components/com_artofcontent/libraries/jxtended/form/fields/accesslevel.php
PHP | 55 lines | 20 code | 7 blank | 28 comment | 0 complexity | 3a016b74ca528af32ccf5c8a7541d847 MD5 | raw file
- <?php
- /**
- * @version $Id: accesslevel.php 484 2010-12-20 23:40:27Z eddieajau $
- * @package JXtended.Libraries
- * @subpackage Form
- * @copyright Copyright (C) 2008 - 2009 JXtended, LLC. All rights reserved.
- * @license GNU General Public License
- * @link http://jxtended.com
- */
- defined('JPATH_BASE') or die('Restricted Access');
- jimport('joomla.html.html');
- require_once dirname(__FILE__).'/list.php';
- /**
- * Form Field class for JXtended Libraries.
- *
- * @package JXtended.Libraries
- * @subpackage Form
- * @since 1.1
- */
- class JFormFieldAccessLevel extends JFormFieldList
- {
- /**
- * The field type.
- *
- * @var string
- */
- protected $type = 'AccessLevel';
- /**
- * Method to get a list of options for a list input.
- *
- * @return array An array of JHtml options.
- */
- protected function _getOptions()
- {
- // Get a database object.
- $db = JFactory::getDbo();
- // Get the user groups from the database.
- $db->setQuery(
- 'SELECT a.id AS value, a.name AS text' .
- ' FROM #__groups AS a' .
- ' ORDER BY a.id ASC'
- );
- $options = $db->loadObjectList();
- // Merge any additional options in the XML definition.
- $options = array_merge(parent::_getOptions(), $options);
- return $options;
- }
- }