<?php
class MyWeb_File_View_Search extends MyWeb_File_View_View
{
	private $_addContent;
	
	/**
	 * 
	 * Metoda prida retezec do vysledneho souboru
	 * @param $content
	 */
	public function add_contentFile($content)
	{
		$this->_addContent = $content;
	}
	
	private function defaultSettings()
	{
		if (is_null($this->_describeTable)){
			$this->_describeTable = $this->_dbTable->get_describeTable();
		}
		if (is_null($this->get_cssLink())){
			$cssLink = '$this->headLink()->appendStylesheet($this->DinamicPath().\'css/form.css\',\'all\');';
			$this->set_cssLink($cssLink);
		}
	}
	
	public function __construct($dbTable,$path = null)
	{
		$this->_dbTable = $dbTable;
		$this->defaultSettings();
		$this->_path = $path;	//*** pridano zajistuje pouziti nove cesty od uzivatele misto default
		$this->set_defaultDirectoryPath($this->_dbTable->get_modelName());
		$this->defaultSettingsPath($this->_default_path_view_php);
		$this->set_typeFile('phtml');
		$this->_currentPrefix = 3;
	}
	
	
	
	public function createContent()
	{
		$stringFile = "";
		$stringFile .=	'<?php'. "\n" .
							'$this->headScript()->appendFile($this->DinamicPath().\'js/windowmsg/jquery.windowmsg-1.0.js\');'	. "\n" .
							'$this->headScript()->appendScript($this->javascriptPopupMain);'	. "\n" .
							'$this->headScript()->appendScript($this->jsOpenLinks);'			. "" .
							$this->get_cssLink()												. "" .
							'ZendX_JQuery::enableView($this);'									. "\n\n" .
							'print $this->form->render();'										. "\n" .
							$this->_addContent													. "\n" .
							'?>'. "\n";
		$this->set_contentFile($stringFile);
	}
}