--- nfo/php/libs/org.netfrag.flib/Site.php 2002/11/12 05:42:30 1.1 +++ nfo/php/libs/org.netfrag.flib/Site.php 2002/12/19 16:25:29 1.4 @@ -1,8 +1,18 @@ _init_logger(); $this->_init_helpers(); $this->_init_application(); - //$this->_init_database(); + $this->_init_database(); + $this->_init_smarty(); + $this->_init_lt(); } // Dispatchers for all subobjects @@ -88,6 +100,14 @@ return $this->request->getRequest(); } + function getLastRequest() { + return $this->request->getCached(); + } + + function cacheRequest($request = array()) { + return $this->request->cacheRequest($request); + } + // dispatchers for Loader function &loadHandler($a) { return $this->loader->loadHandler($a); @@ -95,6 +115,9 @@ function &loadPage($a) { return $this->loader->loadPage($a); } + function &loadTemplate($a, $b = array(), $c = "") { + return $this->loader->loadTemplate($a, $b, $c); + } // dispatchers for Http function &redirect($a) { @@ -133,6 +156,28 @@ } } + function loadCmsPage($template, $data_merge = array()) { + +//print Dumper($this->getRequest()); + + // default data to provide to scope of cms + // TODO/REVIEW: should we be more strict here? + // e.g. just pass in '$site->config->url' or s.th.l.th. + $data = array( + 'config' => $this->config, + 'request' => $this->getRequest(), + ); + + // merge in additional data + foreach ($data_merge as $key => $val) { + $data[$key] = $val; + } + + // load template + $this->loadTemplate($template, $data); + + } + } ?> \ No newline at end of file