<?php
class EVGeneral extends AppEvento{
	
	protected $_accion;
	
	protected $_lanzar = false;
	public function __construct(&$elemento, $selector, $disparador, $accion){
		parent::__construct($disparador);
		$this->setPadre($elemento);
		$this->setSelector($selector);
		$this->disparador = $disparador;
		$this->_accion = $accion;
	}
	
	public function setLanzar($valor){
		$this->_lanzar = $valor;
	}
	
	public function renderEvento(){
		$script = '$('.$this->getSelect().').'.$this->getDisparador().'(function(){
				'.$this->_accion.'
		});
		';
		if($this->_lanzar){
		$script .= '$('.$this->getSelect().').'.$this->getDisparador().'();';	
		}
		return $script;
	}
	
	
	
}

