<?php

/**
* @version 2.8.9
* @package Joomla 2.5
* @subpackage DT Register
* @copyright Copyright (C) 2006 DTH Development
* @copyright contact dthdev@dthdevelopment.com
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/

defined( '_JEXEC' ) or die( 'Restricted access' );

class DtregisterViewConfig extends DtrView {

   	function display($tpl = null){
  			
           JToolBarHelper::save('save');

			JToolBarHelper::cancel('cancel');

			JHTML::_('behavior.tooltip');

			parent::display($tpl);		

		}
	function getUserGroups()
	{
		static $groups;
		if(count($groups) > 0)
		{
		   return $groups;
		}
		// Get a database object.
		$db = JFactory::getDbo();
		// Get the user groups from the database.
		$query = $db->getQuery(true)
			->select('a.id AS value, a.title AS text, COUNT(DISTINCT b.id) AS level')
			->from('#__usergroups AS a')
			->join('LEFT', '#__usergroups AS b on a.lft > b.lft AND a.rgt < b.rgt')
			->group('a.id, a.title, a.lft')
			->order('a.lft ASC');
		$db->setQuery($query);
		$groups = $db->loadObjectList();
        
		return $groups;
	}

}

?>