Updated OSB to work with KH 3.1
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
@@ -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();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -1,7 +1,8 @@
|
||||
<!-- @todo Move this back into the controller, so that we only have HTML views -->
|
||||
<table width="100%" border="0">
|
||||
<?php foreach ($results as $value) {?>
|
||||
<tr>
|
||||
<td class="menu"><a href="<?echo URL::site(Request::instance()->uri(array('action'=>'view','id'=>$value->id)));?>"><?php echo $value->name?></a></td>
|
||||
<td class="menu"><a href="<?echo URL::site(Request::current()->uri(array('action'=>'view','id'=>$value->id)));?>"><?php echo $value->name?></a></td>
|
||||
</tr>
|
||||
<?}?>
|
||||
</table>
|
||||
|
Reference in New Issue
Block a user