This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
khosb/modules/static_page/classes/controller/staticpage.php
2011-05-03 09:49:04 +10:00

37 lines
1.1 KiB
PHP

<?php defined('SYSPATH') or die('No direct access allowed.');
/**
* This class provides static pages
*
* @package OSB
* @subpackage Page
* @category Controllers
* @author Deon George
* @copyright (c) 2010 Deon George
* @license http://dev.leenooks.net/license.html
*/
class Controller_StaticPage extends Controller_TemplateDefault {
/**
* By default show a menu of available categories
* @todo Only show categories according to their validity dates
*/
public function action_view($id) {
$sp = ORM::factory('staticpage',$id);
if (! $sp->loaded())
Request::instance()->redirect('staticpage_category/index');
array_push($this->_control,
array($sp->staticpage_category->name=>sprintf('staticpage_category/view/'.$sp->static_page_category_id)));
array_push($this->_control,array($sp->staticpage_translate->title=>$this->request->uri()));
Block::add(array(
'title'=>$sp->staticpage_translate->title,
'body'=>View::factory('staticpage/view')
->set('record',$sp),
));
$this->template->content = Block::factory();
}
}