<?
$menu_array=array(
"0"=>array("name"=>"","url"=>"","child"=>array('A','B','F','G')),
"A"=>array("name"=>"参数设定","url"=>"admin.php?action=setConf","child"=>array()),
"B"=>array("name"=>"文章管理","url"=>"admin.php","child"=>array('C','D','E')),
"C"=>array("name"=>"添加分类","url"=>"admin.php?action=addCategory","child"=>array()),
"D"=>array("name"=>"分类管理","url"=>"admin.php","child"=>array()),
"E"=>array("name"=>"添加文章","url"=>"admin.php?action=addArticle&cid=0","child"=>array()),
"F"=>array("name"=>"发布站点","url"=>"admin.php?action=outPut","child"=>array()),
"G"=>array("name"=>"退出登陆","url"=>"logout.php","child"=>array()),
);

function makeMenu($menu){
	$ret ="
     <TABLE cellSpacing=0 cellPadding=0 width=173 border=0>
      <TBODY>
        <TR> 
          <TD bgColor=#2650a6><IMG height=29 src=\"images/menu/na.gif\" 
            width=11></TD>
          <TD colspan=\"2\" bgColor=#2650a6><img src=\"images/menu/zzfw02.gif\" width=\"136\" height=\"18\"></TD>
        </TR>
        <TR> 
	";
	foreach($menu[0][child] as $sid){
	$url="";
	$name=$menu[$sid][name];
	$url =$menu[$sid][url];
	$child = $menu[$sid][child];
	if(count($child)>0){
	$ret.="
          <TD bgColor=#2650a6>&nbsp;</TD>
          <TD width=\"134\" height=\"29\" bgColor=#5173b8>　 <a href=\"javascript:actMenu('menu$sid')\" class=\"white\">$name</a></TD>
          <TD width=\"34\" bgColor=#5173b8><img src=\"/images/menu/b02.gif\" width=\"15\" height=\"9\"></TD>
        </TR>
        <TR> 
          <TD bgColor=#ffffff colSpan=3><IMG height=1 src=\"images/space.gif\" 
            width=1></TD>
        </TR>
	";
	$ret.="
	<TR id=\"menu$sid\" style=\"display:none\"> 
		  <TD colspan=\"3\" bgColor=#c9d4ea><TABLE width=173 border=0 cellPadding=0 cellSpacing=0>
		      <TBODY>
		";
		foreach($child as $ssid){
			$name=$menu[$ssid][name];
			$url =$menu[$ssid][url];
			$ret.="
			                <TR> 
                  <TD height=\"29\" bgColor=#2650a6>&nbsp;</TD>
                  <TD colspan=\"2\" bgColor=#c9d4ea> 　　 <A class=blue href=\"$url\">$name</A></TD>
                </TR>
                <TR> 
                  <TD bgColor=#ffffff colSpan=3><IMG height=1 src=\"/webserver/a_files/c.gif\" 
						width=1></TD>
                </TR>
		";
		}
		$ret.="
			</TBODY>
		    </TABLE></TD>
		</TR>
		";
	}else{
		$ret.="        <TR> 
          <TD width=11 height=\"29\" bgColor=#2650a6>&nbsp;</TD>
          <TD width=165 colspan=\"2\" bgColor=#5173b8> 　 <A class=white
      href=\"$url\"><font color=yellow>$name</font></a></TD>
        </TR>
        <TR> 
          <TD bgColor=#ffffff colSpan=3><IMG height=1 src=\"/webserver/a_files/blank.gif\" 
            width=1 border=0></TD>
        </TR>";
	}
	}
	$ret.="
	      </TBODY>
    </TABLE>
    ";
    return $ret;
}
?>