import('hr.dimedia.framework.InterceptingFilter');
import('hr.dimedia.framework.Controller');
import('hr.dimedia.template.Template');
/**
* This abstract class makes a foundation for specific Site classes.
* It handles the authentication and invokes the display of the initial View.
*
* @author Berislav Lopac berislav.lopac@dimedia.hr
* @version 1.0
*/
class ViewController extends InterceptingFilter {
var $sitemap = array();
var $pageKey;
/**
* Contructor for the class.
*
* @param $_task A String defining the task ??? (deprecated?)
* @param $_auth A Boolean value defining whether to authenticate the visitor.
*/
function &ViewController($_task = '', $_auth = false) {
$this->configure();
$this->setPageKey($_REQUEST[CONTKEY]);
if($_auth) $this->authenticate($_auth);
$sitemap = array();
if(isset($this->setup[OMNI])) $sitemap = $this->setup[OMNI];
$sitemap[CONTENTS] = $GLOBALS[SITEMAP];
$this->setSitemap($sitemap);
$this->display($this->getSitemap());
}
/**
* Retrieves a {@link Controller} object specified by the parameter.
* @param $_name A String containing the name of the Controller
to be created.
* @return Controller
*/
function &getController($_name) {
$c =& new Controller($_name, $this->getDb(), $_REQUEST);
return $c;
}
/**
* Sets the $sitemap property.
* @param $_sitemap Array containing the sitemap.
*/
function setSitemap($_sitemap) {
$this->sitemap = $_sitemap;
}
/**
* Returns the $sitemap
property.
* @return Array
*/
function &getSitemap() {
return $this->sitemap;
}
/**
* Abstract method for displaying a View.
*/
function display() {
}
/**
* Sets the {@link pageKey} property. That property defines which section of the site is to be displayed.
* @param $_key A string -- the value that the property is to be set to.
* If omitted, the default value is used.
*/
function setPageKey($_key = false) {
$this->pageKey = $_key ? $_key : $this->setup[DEF][CONTKEY];
}
/**
* Returns the value of the {@link pageKey} property.
* @return String
*/
function getPageKey() {
if(!isset($this->pageKey)) $this->setPageKey();
return $this->pageKey;
}
}
?>
Fatal error: Class 'ViewController' not found in /var/www/vhosts/eurodelta.hr/httpdocs/_classes/hr/dimedia/framework/Site.class.php on line 14