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/product/classes/Controller/Product.php

57 lines
1.4 KiB
PHP
Raw Normal View History

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