40 lines
988 B
PHP
40 lines
988 B
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_Category extends Controller_TemplateDefault {
|
|
/**
|
|
* By default show a menu of available categories
|
|
*/
|
|
public function action_index() {
|
|
HTTP::redirect('product_category/list');
|
|
}
|
|
|
|
public function action_list() {
|
|
Block::add(array(
|
|
'title'=>_('Product Categories'),
|
|
'body'=>View::factory('product/category/list')
|
|
->set('results',$this->_get_categories()),
|
|
));
|
|
}
|
|
|
|
/**
|
|
* Obtain a list of our categories
|
|
* @todo Only show categories according to the users group memeberhsip
|
|
* @todo Obey sort order
|
|
* @todo Move this to the model
|
|
*/
|
|
private function _get_categories() {
|
|
return ORM::factory('Product_Category')
|
|
->list_active();
|
|
}
|
|
}
|
|
?>
|