<?php
/**
* @version $Id: chalange.php
* @package Joomla
* @copyright Copyright (C) 2010 - 2010 Pablo Cárcaba. All rights reserved.
* @license GNU/GPL, see LICENSE.php
*/
// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die( 'Restricted access' );
class JElementChalange extends JElement
{
/**
* Element name
*
* @access protected
* @var string
*/
var $_name = 'Chalange';
function fetchElement($name, $value, &$node, $control_name)
{
$db =& JFactory::getDBO();
$query = 'SELECT a.id, a.name as title'
. ' FROM #__gcd_chalanges AS a'
. ' ORDER BY title'
;
$db->setQuery( $query );
$options = $db->loadObjectList();
array_unshift($options, JHTML::_('select.option', '0', '- '.JText::_('Select Chalange').' -', 'id', 'title'));
return JHTML::_('select.genericlist', $options, ''.$control_name.'['.$name.']', 'class="inputbox"', 'id', 'title', $value, $control_name.$name );
}
}