<?php
/*
	Copyright(c) 2010 Shift Tech Inc. All Rights Reserved.
 	http://www.shift-tech.jp/

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
require_once (LIB_PATH.'/common/pageView.php');
require_once (LIB_PATH.'/common/unitCache.php');
class Pc_Index extends pageView
{
	var $_sidxdata = null;

	function prepare($view)
	{
		//ページ初期化
		if(!$this->initPage(&$view)) {
			return ERR404TPL;
		}
		//ユニット編集エリア情報の取得
		$htmldata = $this->getPageData(&$view, UNITSCACHE);
		/*if($htmldata==null&&$this->_prev==0) {
			return ERR404TPL;
		}*/
		$view->assign('preview', ($this->_prev) ? 1 : 0);
		if($this->_prev){
			$view->assign('items',"<div style='width:100%;line-height:3em;color:#f33;position:absolute;top:10px;left:0px;text-align:center'><h1>プレビュー表示中</h1><p>※リンク先は公開されているページとなっています。</p></div>".$htmldata);
		} else {
			$view->assign('items',$htmldata);
		}
		$view->assign('sidx_data',$this->_sidx_data);
		$view->assign('cat_data',$this->_cat_data);
		$view->assign('pidx_data',$this->_pidx_data);
		$view->assign('m_menu',$this->_gmenu);
		$view->assign('sub_menu',$this->_smenu);
		$view->assign('header',$this->_header);
		$view->assign('footer',$this->_footer);
		$view->assign('SIDE',$this->_sidebar);

		if(isset($this->_gmenu[1][url])&&$this->_gmenu[1][url]!="") {
			$view->assign("BINGOROOTURL",$this->_gmenu[1][url]);
		}

		$view->assign("JS",  '_common/js.tpl');
		
		if($this->_skin_data["skin_path"]!=null) {
			$view->assign("CSS",$this->_skincss_path);
		}
		
		$view->assign("PAGENAVI",$this->getPagenavi());
		
		if(is_file($this->_sidx_data["skin_path"])) {
			return $this->_sidx_data["skin_path"];
		} else {
			return ERR404TPL;
		}

	}

	/**	
	 *	indexアクションの実装
	 *
	 *	@access	public
	 *	@return	string	遷移名
	 */
	function perform($view)
	{
        return null;
	}
}
?>
