<?php
/**
 * @package    Ajax Contact
 * @author     Douglas Machado {@link http://ideal.fok.com.br}
 * @author     Created on 25-Mar-2009
 * @license		GNU/GPL, see LICENSE.php in Joomla root directory
 * Ajax Contact is free software. This version may have been modified pursuant
 * to the GNU General Public License, and as distributed it includes or
 * is derivative of works licensed under the GNU General Public License or
 * other free or open source software licenses. 
 */


// Check to ensure this file is within the rest of the framework
defined('JPATH_BASE') or die();

/**
 * Renders a CustomFieldType element
 *
 * @package 	Contact_Enhanced
 * @since		1.5.7.1
 */

class JElementCustomfieldtype extends JElement
{
	/**
	* Element name
	*
	* @access	protected
	* @var		string
	*/
	var	$_name = 'Customfieldtype';

	function fetchElement($name, $value, &$node, $control_name)
	{
		$group	= $node->attributes('group');
		$options	= array();
		$options[]	= JHTML::_( 'select.option', 0, 			JText::_( 'Do not show' ) );
		$options[]	= JHTML::_( 'select.optgroup', JText::_('One per Category') );
		$options[]	= JHTML::_( 'select.option', "name", 		JText::_( 'Name' ) );
		$options[]	= JHTML::_( 'select.option', "lastname", 	JText::_( 'Last name' ) );
		$options[]	= JHTML::_( 'select.option', "email", 		JText::_( 'Email' ) );
		$options[]	= JHTML::_( 'select.option', "subject", 	JText::_( 'Subject' ) );
		$options[]	= JHTML::_( 'select.option', "cc", 			JText::_( 'Carbon copy' ) );
		$options[]	= JHTML::_( 'select.optgroup', JText::_('General') );
		$options[]	= JHTML::_( 'select.option', "text", 		JText::_( 'Text' ) );
		$options[]	= JHTML::_( 'select.option', "checkbox", 	JText::_( 'Checkbox' ) );
		$options[]	= JHTML::_( 'select.option', "radiobutton", JText::_( 'Radiobox' ) );
		$options[]	= JHTML::_( 'select.option', "selectlist", 	JText::_( 'Select List' ) );
		$options[]	= JHTML::_( 'select.option', "multitext", 	JText::_( 'Textarea (multiple text)' ) );
		$options[]	= JHTML::_( 'select.option', "textemail", 		JText::_( 'Text with email validation' ) );
			
		return JHTML::_('select.genericlist', $options , ''.$control_name.'['.$name.']', 'class="inputbox"', 'value', 'text', $value, $control_name.$name);
	}
}
