<?php
defined('PP_PATH') or exit;
class cate_control extends base_control{
	public $_cfg = array();
	public $_var = array();
	public function index() {
		$_GET['cid'] 	= (int)R('cid');
		$order 			= (int)R('order','C');
		$this->_var = $this->category->get_cache($_GET['cid']);
		empty($this->_var) && core::error404();
		$this->_cfg = $this->runtime->xget();
		$this->_cfg['titles'] = $this->_var['name'].(empty($this->_var['seo_title']) ? '' : '/'.$this->_var['seo_title']);
		!empty($this->_var['seo_keywords']) && $this->_cfg['seo_keywords'] = $this->_var['seo_keywords'];
		!empty($this->_var['seo_description']) && $this->_cfg['seo_description'] =  $this->_var['seo_description'];
		$this->assign('pp', $this->_cfg);
		$this->assign('pp_var', $this->_var);
		$this->assign('order', $order);
		$GLOBALS['run'] = &$this;
		$_ENV['_theme'] = &$this->_cfg['theme'];
		$this->display($this->_var['cate_tpl']);
	}
}
