Theme work with focusbusiness and baseadmin
Improvements to NAVBAR, updates to StaticList methods, other minor items Enable product category rendering and other minor improvements Added ADSL-large category price plan
This commit is contained in:
@@ -12,26 +12,6 @@
|
||||
class Controller_Product extends Controller_TemplateDefault {
|
||||
protected $auth_required = FALSE;
|
||||
|
||||
/**
|
||||
* Show a list of product categories
|
||||
*/
|
||||
public function action_categorys() {
|
||||
$output = '<div id="category">';
|
||||
$output .= '<ul>';
|
||||
|
||||
foreach (ORM::factory('Product_Category')->list_active() as $pco) {
|
||||
$a = '<h3>'.$pco->display('name').'</h3>';
|
||||
$a .= '<p>'.$pco->description().'</p>';
|
||||
|
||||
$output .= '<li>'.HTML::anchor('product/category/'.$pco->id,$a).'</li>';
|
||||
}
|
||||
|
||||
$output .= '</ul>';
|
||||
$output .= '</div>';
|
||||
|
||||
$this->template->content = $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the available topics in a category
|
||||
*
|
||||
@@ -43,29 +23,15 @@ class Controller_Product extends Controller_TemplateDefault {
|
||||
|
||||
$pco = ORM::factory('Product_Category',$this->request->param('id'));
|
||||
|
||||
if (! $pco->loaded())
|
||||
// Only show categories that are active.
|
||||
if (! $pco->loaded() OR ((! $pco->status AND ! Kohana::$config->load('debug')->show_inactive)))
|
||||
HTTP::redirect('welcome/index');
|
||||
|
||||
if (! $pco->status AND ! Kohana::$config->load('debug')->show_inactive)
|
||||
HTTP::redirect('welcome/index');
|
||||
Style::factory()
|
||||
->type('file')
|
||||
->data('media/css/pages/welcome.css');
|
||||
|
||||
BreadCrumb::name($this->request->uri(),$pco->name);
|
||||
BreadCrumb::url('product','product/categorys');
|
||||
BreadCrumb::url('product/category','product/categorys');
|
||||
|
||||
foreach ($pco->products() as $po)
|
||||
$output .= View::factory($this->viewpath().'/list_item')
|
||||
->set('co',$pco)
|
||||
->set('o',$po);
|
||||
|
||||
// If our output is blank, then there are no products
|
||||
if (! $output)
|
||||
$output = _('Sorry, no pages were found in this category, or your account is not authorized for this category.');
|
||||
|
||||
Block::add(array(
|
||||
'title'=>sprintf('%s: %s',_('Category'),$pco->name),
|
||||
'body'=>$output,
|
||||
));
|
||||
return $this->template->content = (string)$pco->template();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -77,28 +43,14 @@ class Controller_Product extends Controller_TemplateDefault {
|
||||
$po = ORM::factory('Product',$id);
|
||||
|
||||
if (! $po->loaded())
|
||||
HTTP::redirect('Product_Category/index');
|
||||
HTTP::redirect('welcome/index');
|
||||
|
||||
BreadCrumb::name($this->request->uri(),$po->product_translate->find()->name);
|
||||
BreadCrumb::url('product','product/categorys');
|
||||
// @todo This breadcrumb may not be working anymore.
|
||||
#BreadCrumb::name($this->request->uri(),$po->product_translate->find()->name);
|
||||
#BreadCrumb::url('product','product/categorys');
|
||||
|
||||
// Work out our category id for the control line
|
||||
if (! empty($_GET['cid'])) {
|
||||
$co = ORM::factory('Product_Category',$_GET['cid']);
|
||||
|
||||
// If the product category doesnt exist, or doesnt match the product
|
||||
if (! $co->loaded() OR ! in_array($co->id,$po->avail_category))
|
||||
HTTP::redirect('Product_Category/index');
|
||||
|
||||
BreadCrumb::name('product/view',$co->name);
|
||||
BreadCrumb::url('product/view','product/category/'.$co->id);
|
||||
}
|
||||
|
||||
Block::add(array(
|
||||
'title'=>$po->description_short(),
|
||||
'body'=>View::factory($this->viewpath())
|
||||
->set('record',$po),
|
||||
));
|
||||
$this->template->content = (string)View::factory('product/view')
|
||||
->set('o',$po);
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
Reference in New Issue
Block a user