<?php

/*
*	Copyright VeryIDE,2007-2010
*	http://www.veryide.com/
*
*	$Id: page.header.php,v3 19:47 2008-2-18 Leilei $
*/
	
/*

	后台子框架公共头部

*/

///////////////////////////////////

//载入依赖库以及配置
require_once dirname(__FILE__)."/../include/global.php";

//加载模块公共函数包
require_once dirname(__FILE__)."/../module/function.php";

////////////////////框架公共函数块_开始///////////////////////

//页面DTD
function html_dtd(){
	global $Project;

	echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset='.$Project["charset"].'" />
<meta http-equiv="X-UA-Compatible" content="IE=7" />
<meta name="robots" content="noindex, nofollow" />'.chr(13);
}

//页面Meta
function html_meta(){
	global $Project;
	global $Product;
	echo '<meta name="veryide" version="'.$Project["version"].'" build="'.$Project["build"].'" charset="'.$Project["charset"].'" />'.chr(13);
	echo '<meta name="product" name="'.$Product["appname"].'" version="'.$Product["version"].'" />'.chr(13);
}

/*
	页面开始执行
	$title		页面标题
*/
function html_start($title){
	global $Project;
	
	//页面开始执行
	$Project["time_start"]=microtime();
	
	echo '<title>'.$title.'</title>';
	
	//'core','library','drag','ajax'
	$scripts=array( 'mo','mo.ajax','mo.drag','mo.interface','mo.calendar','mo.ubb','mo.form','mo.ui' );
	
	for ( $i = 0 ; $i < count($scripts) ; $i++ ) {
		echo chr(13).'<script type="text/javascript" charset="utf-8" src="'.VI_BASE.'js/'.$scripts[$i].'.js?ver='.$Project["version"].'"></script>';
	}

	echo chr(13).'<script type="text/javascript">';
	reader_config();
	echo '</script>';
	
	echo chr(13).'
	<script type="text/javascript" charset="utf-8" src="'.VI_BASE.'js/serv.dialog.js?ver='.$Project["version"].'"></script>
	<script type="text/javascript" charset="utf-8" src="'.VI_BASE.'js/serv.upload.js?ver='.$Project["version"].'"></script>
	
	</head>
	
	<body>
	<div id="wrapper">
	<!--div id="loading">Loading...</div-->
	';
	
}

//页面结束执行
function html_close(){
	global $Project;
	
	//页面结束执行
	$Project["time_end"]=microtime();
	
	//页面执行耗时
	echo '<!--Processed in '. ($Project["time_end"]-$Project["time_start"]) .' second(s) , '.$Project["queries"].' queries-->';
	
	//window.setTimeout("Mo.Manager.frLoad();",1000);
	
	//"'.$Project["class"].'",
	//,"'.$Project["jump"].'"
	
	echo '
	</div>
	<script type="text/javascript">Serv.Manager.frLoad();Mo.Message("'.( $Project["class"] ? $Project["class"] : "info" ).'", '.( $Project["message"] ? '\'<div class="s"></div><div class="c">'.$Project["message"].'</div><div class="e"></div>\'' : '""' ).' , 3, { "unique" : "message" } );</script>
	</body>
	</html>';
	
	/*
	echo '
	</div>
	<script type="text/javascript">Mo.Message("message","","'.$Project["message"].'",3,"'.$Project["jump"].'"); window.setTimeout("Mo.Manager.pageLoad();",1000);</script>
	</body>
	</html>';
	*/
}

////////////////////框架公共函数块_结束///////////////////////

//登录状态
checker_login();

//HTML DTD
html_dtd();

//HTML CSS
echo loader_style(array(VI_BASE."style/dialog.css",VI_BASE."style/ubb.css",VI_BASE."style/ui.css",VI_BASE."style/calendar.css"),"utf-8",$Project["version"]);

/****************************/	

//页面消息
if ( isset($_GET["VMSG"]) ){
	if( count($_GET["VMSG"]) > 1 ){
		$Project["message"]=$_GET["VMSG"][count($_GET["VMSG"])];
	}else{
		$Project["message"]=$_GET["VMSG"];
	}
}

//跳转地址
$Project["jump"] = GetQuery("jump");

//错误跟踪
set_error_handler("show_error");	

/****************************/

//页面权限
checker_page();
	
?>