<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Index extends CI_Controller {

	function __construct(){
		    parent::__construct();
        	$this->load->helper('url');
            $this->load->library('session'); //加载session
		    $this->load->model('CsdjDB');
		    $this->load->model('CsdjSkins');
		    $this->load->model('CsdjCache');
	}

	public function index()
	{
            $data='';
            //判断运行模式
            $cscms=$this->security->xss_clean($this->input->get('cs', TRUE));
	        if(Web_Mode==3 && $cscms!="html" && file_exists(Html_Index)){
                header("Location: ".Html_Index.""); 
                exit;
            }
	        $cache_id ="index_home";
	        if(!($this->CsdjCache->start($cache_id))){
                $this->load->get_templates();
		        $template=$this->load->view('cs-index.html',$data,true);
                $this->CsdjSkins->skins($template,$data);
		        $this->CsdjCache->end();
	        }
	}

	//保存到桌面
	public function short()
	{
            $Shortcut = "[InternetShortcut] 
                URL=http://".Web_Url."
                IDList= 
                [{000214A0-0000-0000-C000-000000000046}] 
                Prop3=19,2 
            "; 
            Header("Content-type: application/octet-stream"); 
            header("Content-Disposition: attachment; filename=".Web_Name.".url;"); 
            echo $Shortcut;
	}
}



