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.
Deon George 29c1913f47 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
2013-05-02 20:49:30 +10:00

57 lines
1.4 KiB
PHP

<?php defined('SYSPATH') or die('No direct access allowed.');
/**
* This class provides product categories
*
* @package Product
* @category Controllers
* @author Deon George
* @copyright (c) 2009-2013 Open Source Billing
* @license http://dev.osbill.net/license.html
*/
class Controller_Product extends Controller_TemplateDefault {
protected $auth_required = FALSE;
/**
* Show the available topics in a category
*
* @todo Only show categories according to their validity dates
* @todo Obey sort order
*/
public function action_category() {
$output = '';
$pco = ORM::factory('Product_Category',$this->request->param('id'));
// Only show categories that are active.
if (! $pco->loaded() OR ((! $pco->status AND ! Kohana::$config->load('debug')->show_inactive)))
HTTP::redirect('welcome/index');
Style::factory()
->type('file')
->data('media/css/pages/welcome.css');
return $this->template->content = (string)$pco->template();
}
/**
* Show a product
*/
public function action_view() {
$id = $this->request->param('id');
$po = ORM::factory('Product',$id);
if (! $po->loaded())
HTTP::redirect('welcome/index');
// @todo This breadcrumb may not be working anymore.
#BreadCrumb::name($this->request->uri(),$po->product_translate->find()->name);
#BreadCrumb::url('product','product/categorys');
$this->template->content = (string)View::factory('product/view')
->set('o',$po);
}
}
?>