--- 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/23 11:33:58 1.5 @@ -1,8 +1,21 @@ _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,12 +103,23 @@ 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); } - function &loadPage($a) { - return $this->loader->loadPage($a); + function &loadPage($a, $b = array()) { + return $this->loader->loadPage($a, $b); + } + function &loadTemplate($a, $b = array(), $c = "") { + return $this->loader->loadTemplate($a, $b, $c); } // dispatchers for Http @@ -133,6 +159,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