<?php 
# Name: PHP版程氏音乐CMS管理系统 v3.0
# Author: 程氏<web@chshcms.com> [QQ:848769359]
# Homepage:http://www.chshcms.cn/
include_once("../../lib/cs_conn.php");
include_once("../../lib/cs_common.php");
include_once("../loginstate.php");
SystemPer('5_4');
$menu=@trim($_POST["menu"]);
if($menu){
	$menuarr=explode(chr(13),$menu);
	$menustr="<!--".$menu."-->\r\n";
	for($i=0;$i<count($menuarr);$i++){
		$menuinfo=explode("|",$menuarr[$i]);
		$menustr.="<dt class=\"disabled\"><a href=".$menuinfo[1]." target=main>".$menuinfo[0]."</a></dt>\r\n";
		}
	fwrite(fopen("quickmenu.php","wb"),$menustr);	
	    echo "<script>window.location='custon.php'</script>";
	}
?>
<!doctype html>
<html>
<head>
<meta charset=utf-8>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<title>chshdjcms management</title>
<link href="../res/css/admin_style.css" rel="stylesheet" />
</head>
<body>
<div class="wrap">
	<div class="h_a">常用菜单</div>
	<form action="" method="post" class="J_ajaxForm" id="J_backup_form">
	<div class="table_full">
		<table width="100%">
			<col class="th" />
			<tr>
				<th>常用菜单设置</th>
				<td>
					<div class="sql_list J_check_wrap">
						<dl>
							<dt>
								<span style="color:red">＊菜单格式说明：“歌曲管理|./dance/dance.php”,标题与地址的分隔符为“|”,每条菜单写一行！</span>
							</dt>
							<dd>
                                                                <textarea rows="50" name="menu" id="menu" style="width:98%;height:290px;font-family:Georgia, 'Times New Roman', Times, serif"><?php echo CS_ReplaceStr(substr(file_get_contents("quickmenu.php"),0,strpos(file_get_contents("quickmenu.php"),"-->")),"<!--","");?></textarea>
							</dd>
						</dl>
					</div>
				</td>
			</tr>
		</table>
	</div>
	<div class="btn_wrap">
		<div class="btn_wrap_pd">
		<button class="btn btn_submit J_ajax_submit_btn" id="custon_btn" type="submit">保存设置</button>
		<div id="J_backup_tip"></div>
		</div>
	</div>
	</form>
</div>
</body>
</html>
