<?php
class EtiquetaField extends FormField {
	
	/**
	 * Returns an input field, class="text" and type="text" with an optional maxlength
	 */
	function __construct($name, $title = null, $value = "", $form = null){
		parent::__construct($name, $title, $value, $form);
	}
	
	function Field() {
		$attributes = array(
			'class' => 'text' . ($this->extraClass() ? $this->extraClass() : ''),
			'id' => $this->id(),
			'name' => $this->Name(),
			'value' => $this->Value(),
			'tabindex' => $this->getTabIndex(),
		);
		
		if($this->disabled) $attributes['disabled'] = 'disabled';
		
		return $this->createTag('label', $attributes);
	}
	
	function InternallyLabelledField() {
		if(!$this->value) $this->value = $this->Title();
		return $this->Field();
	}
	
}
?>