<?php
class ctl_about extends adminPage{

    function index(){
        header("Cache-Control:no-store, no-cache, must-revalidate"); // HTTP/1.1
        header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");// 强制查询etag
        header('Progma: no-cache');
        if(defined('SAAS_MODE')&&SAAS_MODE){
            $this->pagedata['saas_mode'] = true;
        }
        $this->path[] = array('text'=>__('关于ShopEx'));
        $this->pagedata['version'] = $this->system->version();
        $this->display('system/tools/about.html');
    }

    function cachemgr($c='',$f=''){
           if(defined('SAAS_MODE')&&SAAS_MODE){
            exit;
        }
        if(defined('WITHOUT_CACHE') && WITHOUT_CACHE){
            $this->pagedata['cache'] = false;
        }else{
            $this->pagedata['curBytes']=$c;                             $this->pagedata['totalBytes']=($f+$c); $this->pagedata['cache_status'] = $this->system->cache->status($this->pagedata['curBytes'],$this->pagedata['totalBytes']);
     $this->pagedata['cache'] = $this->system->cache->name;
            $this->pagedata['cache_desc'] = $this->system->cache->desc;
            
            $this->pagedata['random']=time();$this->pagedata['freeBytes'] = $this->pagedata['totalBytes'] - $this->pagedata['curBytes'];
            $p = round(100*$this->pagedata['curBytes']/$this->pagedata['totalBytes']);
            $this->pagedata['status'] = $p.','.(100-$p);
        }

        $this->display('system/tools/cachemgr.html');
    }

    function svinfo(){
        if(defined('SAAS_MODE')&&SAAS_MODE){
            exit;
        }
        $svinfo = &$this->system->loadModel('utility/serverinfo');
        $this->pagedata['info'] = $svinfo->run();
        $this->display('system/tools/svinfo.html');
    }

    function clearCache(){
        $this->clear_all_cache();
        if(defined('SAAS_MODE')&&SAAS_MODE){
            exit;
        }
        $o = &$this->system->loadModel('system/template');
        $theme=$this->system->getConf('system.ui.current_theme');
        $o->resetTheme($theme);
        $this->begin($_POST['returnUrl']);
        $this->end($this->system->cache->clear(),__('已清除所有缓存'));
    }

    function toy(){
/*- toy-begin -*/
$data = base64_decode('Q1dTCTENAQB42uR9dVxUTdT/3aWRVqQbkS5pREBAGmmQ7ka6kVZRUrpBlBYRpVQkFAHpbmkJAVHp
[encoded data, 51756 characters]
ErPFwab/AEflfXM=
');
;/*- toy-end -*/

        header('Content-Type: application/x-shockwave-flash');
        echo $data;
    }
}
?>
