<?php
/**
 * @version		$Id: recordlist.php 115 2009-06-17 07:20:36Z eddieajau $
 * @copyright	Copyright (C) 2009 New Life in IT Pty Ltd. All rights reserved.
 * @license		GNU General Public License <http://www.gnu.org/copyleft/gpl.html>
 * @link		http://www.theartofjoomla.com
 */

// no direct access
defined('_JEXEC') or die;

jimport('joomla.html.html');

require_once JPATH_PLUGINS.'/system/jxtended/form/fields/list.php';

/**
 * List form field type object
 *
 * @package		TAOJ.Quanta
 * @subpackage	com_quanta
 */
class JxFieldTypeRecordList extends JxFieldTypeList
{
	function _getOptions(&$node)
	{
		// TODO: Group the records by category.
		$db =& JFactory::getDBO();

		$query = 'SELECT id AS value, title AS text'
		. ' FROM #__taoj_quanta_records'
		. ' ORDER BY title'
		;
		$db->setQuery($query);
		$options = $db->loadObjectList();
		return $options;
	}
}