<?php
if (!defined('IN_CONTEXT')) die('access violation error!');
?>
<!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=<?php _e('charset'); ?>" />
<title><?php echo $_SITE->site_name; ?>网站系统管理</title>
<link rel="stylesheet" type="text/css" href="<?php echo P_TPL_WEB; ?>/css/style.css" />
<script language="javascript" src="iepngfix_v2/iepngfix_tilebg.js"></script>
<?php include_once(P_INC.'/global_js.php'); ?>
<!-- Overlay style -->
<style type="text/css">
<!--
    #loading_overlay {
        position: fixed;
        left: 0px;
        top: 0px;
        width: 100%;
        height: 100%;
        z-index: 190;
        background: #000;
        filter:alpha(opacity=50);
        -moz-opacity:0.5;
        opacity: 0.5;
    }
    #loading_anim{
        position: fixed;
        height:13px;
        width:208px;
        z-index:191;
        top: 50%;
        left: 50%;
        margin: -6px 0 0 -104px; /* -height/2 0 0 -width/2 */
    }
    * html #loading_anim { /* ie6 hack */
    position: absolute;
    margin-top: expression(0 - parseInt(this.offsetHeight / 2) + (TBWindowMargin = document.documentElement && document.documentElement.scrollTop || document.body.scrollTop) + 'px');
    }
-->
</style>
<!-- // Overlay style -->
</head>

<body>
    <script type="text/javascript" language="javascript">
    <!--
    function show_overlay() {
        $("#loading_overlay").css("display", "block");
        $("#loading_anim").css("display", "block");
    }
    function hide_overlay() {
        $("#loading_overlay").css("display", "none");
        $("#loading_anim").css("display", "none");
    }
    function reset_tpl_data() {
        if (!confirm("<?php _e('Continue resetting will erase all your data! Are you SURE?'); ?>")) return;
        if (!confirm("<?php _e('Think again! Seriously! Are you SURE?'); ?>")) return;
        show_overlay();
        _ajax_request("mod_site", 
            "reset_tpl_data", false, 
            on_reset_success, 
            on_reset_failure);
    }
    
    function on_reset_success(response) {
        var o_result = _eval_json(response);
        if (!o_result) {
            return on_reset_failure(response);
        }
        
        if (o_result.result == "ERROR") {
            alert(o_result.errmsg);
            hide_overlay();
            return false;
        } else {
            alert("<?php _e('Resetting finished successfully!'); ?>");
            hide_overlay();
            return true;
        }
    }
    
    function on_reset_failure(response) {
        alert("<?php _e('Request failed!'); ?>");
        hide_overlay();
        return false;
    }
    
    // 23/03/2010 Jane Add >>
    function siteGuid() 
    {
        show_iframe_win('index.php?<?php echo Html::uriquery('mod_wizard', 'admin_index'); ?>', '', 732, 503);
	}
	function siteAbout() 
    {
        show_iframe_win('index.php?<?php echo Html::uriquery('mod_about', 'admin_index'); ?>', '', 395, 225);
	}
	// 23/03/2010 Jane Add <<
    
    //-->
    </script>
    <!-- Loading overlay -->
    <div id="loading_overlay" style="display:none;"></div>
    <div id="loading_anim" style="display:none;"><img src="images/loadingAnimation.gif" /></div>
    <!-- // Loading overlay -->
    <div id="wrap">
        <?php if(ParamHolder::get('frame', 1)) {
        $o_locale = new Parameter();
    	$locale_items = $o_locale->findAll("`key` = 'DEFAULT_LOCALE'");
    	$_user = SessionHolder::get('user/login');
    	if($locale_items[0]->val == 'zh_CN') {
    		$showMsg = '您好尊敬的'.$_user.'会员';
    	} elseif($locale_items[0]->val == 'en') {
    		$showMsg = 'Hello,'.$_user;
    	}
        if(DEFAULT_LOCALE == 'zh_CN') {
        	$msg1 = '<li><a href="#" onclick="siteGuid()">'.__('Guide').'</a>&nbsp;&nbsp;|&nbsp;&nbsp;</li>';
        }
        $str = '<div id="top">
                <a target="_blank" href="http://www.sitestar.cn"><img style="border:none;" width="735" height="53" src="'.P_TPL_WEB.'/images/top.jpg"/></a>
                <ul>
                    <li><a href="index.php">'.__('Dashboard').'</a>&nbsp;&nbsp;|&nbsp;&nbsp;</li>'.$msg1.
                    '<li><a href="http://help.sitestar.cn" target="_blank">'.__('Help').'</a>&nbsp;&nbsp;|&nbsp;&nbsp;</li>
                        
                    <li><a href="#" onclick="siteAbout()">'.__('About').'</a>&nbsp;&nbsp;|&nbsp;&nbsp;</li>
                        
                    <li><a class="exit" href="index.php?'.Html::xuriquery('frontpage', 'dologout').'" title="Logout">'.__('Logout').'</a></li>
                </ul>   
            </div>
            
            <div id="list">
                <div id="menu_l"><span class="icon1">'.$showMsg.'</span></div>
                <ul>';
        $o_admin_menu_category = new AdminMenuCategory();
        $admin_menu_category_items = $o_admin_menu_category->findAll();
		$flag = false;
        foreach($admin_menu_category_items as $v){
            if($v->module == 'mod_modules' && $v->action == 'index') {
                $str .= '<li class="lii"><a href="index.php?'.Html::xuriquery('mod_modules', 'index').'" target="_blank">'.__('Layouts').'</a></li>';
                $flag = true;
            }
            
            if($v->module == 'mod_authorization' && $v->action == 'admin_list'){
                $str .= '<li class="lii"><a style="color:#F30;background:none;" href="http://www.sitestar.cn/license/" target="_blank">'.__('Licenses').'</a></li>';
                $flag = true;
            }
            if(!$flag) {
                $str .= '<li class="lii"><a href="index.php?'.Html::xuriquery($v->module, $v->action).'">'.__($v->category_name).'</a></li>';
            }
            $flag = false;
        }
                             
             $str .= '</ul>
                <div id="menu_r"> <a href="../?_v=preview" target=_blank>'.__('Preview Home').'</a></div>
            </div>';
             
        echo $str;
        }
        ?>