<?php
if (!defined('HUCART_COM')) exit('HuCart.COM No direct script access allowed');
class Clear extends HC_Controller
{
	function __construct()
	{
		parent::__construct();
		$this->load_lang('adminsys/clear');
		$this -> load('admin'); 
		$this -> admin -> online_admin();
	}
	
	function info_list()
	{
		$this -> view ->  caching = true;
		$this -> view ->  cache_lifetime = 86400 ;   //60 *  60 * 24 
		
		$this -> view ->  assign('act_url',ADMIN_WEBURL."/index.php?load=clear&act=clear_all");
		$this -> view ->  display('clear.tpl');	
	}
	
	function clear_all()
	{

		$clear_www 	  = $this -> input -> post["clear_www"];
		$clear_admin  = $this -> input -> post["clear_admin"];
		global $config;
		if($clear_www == 'web')
		{
			$this -> view ->  setCacheDir(ROOT_PATH.$config['view']['tmp_path'].'/www');
			$this -> view ->  clearAllCache();
		}
		
		//清除管理员后台缓存
		if($clear_admin == 'adm')
		{

			$this -> view ->  setCacheDir(ROOT_PATH.$config['view']['tmp_path'].'/adminsys');
			$this -> view ->  clearAllCache();
		}

		$this -> view ->  assign('info_title',$this->lang['claer_susse']);
		$this -> view ->  assign('URL_TIME',URL_TIME);
		$this -> view ->  assign('get_url',ADMIN_WEBURL."/?load=clear&act=info_list");
		$this -> view ->  display('suggestion.tpl');	
		
	}
	
		
}


?>