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/Category.php

41 lines
993 B
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
*
* @package OSB
* @subpackage Page
* @category Controllers
* @author Deon George
* @copyright (c) 2010 Deon George
* @license http://dev.leenooks.net/license.html
*/
class Controller_Product_Category extends Controller_TemplateDefault {
/**
* By default show a menu of available categories
*/
public function action_index() {
2012-11-09 23:13:57 +00:00
HTTP::redirect('product_category/list');
}
public function action_list() {
2010-11-29 22:41:08 +00:00
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
2011-05-14 07:35:33 +00:00
* @todo Move this to the model
2010-11-29 22:41:08 +00:00
*/
private function _get_categories() {
2012-11-09 23:13:57 +00:00
return ORM::factory('Product_Category')
->list_active();
2010-11-29 22:41:08 +00:00
}
}
?>