<?php
/**
* 控制面板头部
* @author: moufer<moufer@163.com>
* @package: modoer
* @copyright: www.modoer.com
* @version $Id: header.inc.php 2 2007-10-11 $
*/
(!defined('IN_ADMIN') || !defined('IN_MUDDER')) && exit('Access Denied');

foreach($arr_main as $key => $value) {
    $cpMenu[] = "'$key'";
    if($key != 'menu') {
        list($ac,$cn,$file,$op) = explode("|", $value);
        $param = "action=$ac&file=$file&op=$op";
        $menuNav .= "\t".'<li class="unselected"><a href="#" onclick="return gotoMenu(this,'."'$key',"."'$param'".');" onfocus="this.blur()">'.$cn.'</a></li>'."\r\n";
    }
}
$cpMenu = implode(",", $cpMenu);

?>
<!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=<?=$charset?>">
<link rel="stylesheet" type="text/css" id="css" href="./images/admin/admin.css">
<script type="text/javascript">
var cpMenu = new Array(<?=$cpMenu?>);
function gotoMenu(obj,action,param) {
    var selmenu = obj.parentNode;
    var menus = document.getElementById('menu').getElementsByTagName('li');
    if(selmenu){
        selmenu.className = "selected";
        for(var i = 0;i < menus.length;i++) {
            if(menus[i] != selmenu) menus[i].className = "unselected";
        }
        //showSubmenu(action);
        parent.menu.location = 'admincp.php?action=menu&tab=' + action;
        parent.main.location = 'admincp.php?' + param;
    }
    return false;
}
function showSubmenu(Id) {
    for(var i=0;i<cpMenu.length;i++) {
        var obj = parent.menu.document.getElementById('menu_' + cpMenu[i]);
        if(obj){
            obj.style.display = (Id==cpMenu[i]) ? 'block' : 'none';
        }
    }
}
</script>
</head>
<body>
<div id="header">
  <div id="product">Modoer 控制面板</div>
  <div id="nav">
    <div class="op">
        你好：<b><?=$admin->adminname?></b>，欢迎使用Modoer点评系统。
        <a href="<?=$_config['siteurl']?>" target="_blank">网站首页</a>&nbsp;
        <a href="admincp.php" target="_top">后台首页</a>&nbsp;
        <a href="admincp.php?action=logout" target="_top">退出</a>
    </div>
    <ul id="menu">
      <?=$menuNav?>
    </ul>
  </div>
  <div style="clear:both"></div>
</div>
</body>
</html>