--- nfo/php/libs/org.netfrag.flib/Site.php 2002/12/19 06:17:32 1.3 +++ nfo/php/libs/org.netfrag.flib/Site.php 2002/12/23 11:33:58 1.5 @@ -1,8 +1,14 @@ 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); @@ -153,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