* @copyright 2004 by http://wombat.exit0.net * @package wombatSite * @subpackage cmHtml */ /** * Dialog interface * * @todo check user before display! * * @version 0.1.0 * @package wombatSite * @subpackage cmHtml */ class wbDialog { /** * options * @var array $_options */ var $_options = array( 'width' => 500, 'height' => 500, 'class' => 'Dialog', 'title' => 'Wombat Basic Dialog', 'brief' => 'There is no description', 'name' => 'dialog', 'vars' => '', 'type' => 'inline', ); /** * patTemplate object * @var object $_tmpl */ var $_tmpl; /** * constructor * * @access public */ function __construct() { $this->_tmpl =& wbFactory::singleton( 'patTemplate' ); } /** * constructor wrapper for PHP4 * * @access public * @see __construct() */ function wbDialog() { // this should work because dialog should be called by wbDialogController $this->_tmpl =& wbFactory::singleton( 'patTemplate' ); $this->__construct(); } /** * process dialog * * @access public * @param string $html html to be displayed, or null to get it from template * @return boolean $result true */ function process() { $this->_loadTemplates( $this->_options['class'] ); return $this->_tmpl->getParsedTemplate( 'dialog' ); } /** * get options * * @access public * @return array $options associative arrey of options */ function getOptions() { return $this->_options; } /** * load tempaltes * * @access public * @param string $tmpl load dialog template file * @return boolean $result true */ function _loadTemplates( $tmpl ) { return $this->_tmpl->readTemplatesFromInput( 'cmHtml/dialog/' . $tmpl . '.tmpl' ); } } ?>