Updated OSB to work with KH 3.1

This commit is contained in:
Deon George
2011-05-14 17:35:33 +10:00
parent 6d256839fc
commit 9dda9f43f4
42 changed files with 397 additions and 347 deletions

View File

@@ -19,18 +19,15 @@ class Controller_StaticPage extends Controller_TemplateDefault {
$sp = ORM::factory('staticpage',$id);
if (! $sp->loaded())
Request::instance()->redirect('staticpage_category/index');
Request::current()->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()));
Breadcrumb::name($this->request->uri(),$sp->staticpage_translate->find()->title);
Block::add(array(
'title'=>$sp->staticpage_translate->title,
'title'=>$sp->staticpage_translate->find()->title,
'body'=>View::factory('staticpage/view')
->set('record',$sp),
));
$this->template->content = Block::factory();
}
}
?>

View File

@@ -11,22 +11,15 @@
* @license http://dev.leenooks.net/license.html
*/
class Controller_StaticPage_Category extends Controller_TemplateDefault {
protected $_control = array(
array('Site Index'=>'staticpage_category'),
);
/**
* By default show a menu of available categories
*/
public function action_index() {
Block::add(array(
'title'=>_('Site Index Categories'),
'body'=>View::factory('staticpage/category/list')
->set('results',$this->_get_categories()),
));
$this->template->content = Block::factory();
}
/**
@@ -38,17 +31,15 @@ class Controller_StaticPage_Category extends Controller_TemplateDefault {
$spc = ORM::factory('staticpage_category',$id);
if (! $spc->loaded())
Request::instance()->redirect('welcome/index');
Request::current()->redirect('welcome/index');
array_push($this->_control,array($spc->name=>$this->request->uri()));
Breadcrumb::name($this->request->uri(),$spc->name);
Block::add(array(
'title'=>sprintf('%s: %s',_('Category'),$spc->name),
'body'=>View::factory('staticpage/category/view')
->set('results',$this->_get_category($spc->id)),
));
$this->template->content = Block::factory();
}
/**