<?php

/**
 *
 * @author Peter Csubak (chuby)
 * @copyright Peter Csubak (chuby)
 */
class PTextField extends PComponent{

	/** @CProperty */
	protected $name;
	/** @CProperty */
	protected $size;
	/** @CProperty */
	protected $style;
	/** @CProperty */
	protected $value;
	
	// Ide maj ki kell guglizni, az eseményeit
	
	public function __construct($name = "", $value = "", $size = 10, $style = "", $id = "", $cssclass = "", $evtslock = ""){
		$this->name = $name;
		$this->size = $size;
		$this->value = $value;
		$this->id = $id;
		$this->cssclazz = $cssclass;
		$this->style = $style;
		$this->eventsLock = $evtslock;
	}
	
	public function render(){
		$res .= "<input type=\"text\"";
		
		if ($this->id != ""){
			$res .= " id=\"".$this->id."\"";
		}
		
		if ($this->cssclazz != ""){
			$res .= " class=\"".$this->cssclazz."\"";
		}
		
		if ($this->style != ""){
			$res .= " style=\"".$this->style."\"";
		}
		
		if ($this->size != null){
			$res .= " size=\"".$this->size."\"";
		}
		
		if ($this->name != ""){
			$res .= " name=\"".$this->name."\"";
		}
		
		if ($this->value != ""){
			$res .= " value=\"".$this->value."\">".$this->value."</input>";
		}else{
			$res .= " />";
		}
		
		return $res;
	}
}
?>