<!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=utf-8" />
<title></title>
<link href="admin/admin/template/style/admin.css" rel="stylesheet" type="text/css" />
<script src="include/js/jquery.js" type="text/javascript"></script>
<script src="include/js/xheditor/xheditor-zh-cn.min.js" charset="utf-8" type="text/javascript"></script>
<script src="include/js/uploadify/swfobject.js" type="text/javascript"></script>
<script src="include/js/uploadify/uploadify.js" type="text/javascript"></script>
<script src="include/js/admin.js" type="text/javascript"></script>
<script type="text/javascript">
$(function(){
	$("#files").uploadify({
		'script'         : 'admin.php',
		'scriptData'	 : {'c':'uploads','isfiles':'Filedata','session_id':'<?php echo session_id();?>'},
		'queueID'        : 'fileQueue',
		'auto'           : true,	//自动上传
		'multi'          : false,	//是否可以传多个文件
		'removeCompleted': true,	//完成移除进度条
		'sizeLimit'		 : <?php echo syExt('filesize') ?>,	//大小限制
		"onError": function (event,queueId,fileObj,errorObj){
				$("#err").empty();$("#fileQueue").empty();
				if(errorObj.type=="File Size"){
					var fSizes = errorObj.info/1024;
					$("#err").append("文件大小不能超过"+fSizes+"K");
				}else{
					$("#err").append("上传出错，请重新操作");
				}
		},
		'onOpen': function (){
				$("#err").empty();
				$("#err").append("<img src='include/js/uploadify/loading.gif' />");
		},
		'onComplete': function (event, queueID, fileObj, response, data){
				var strs=response.split(",");
				$("#err").empty();
				if(strs[0]!=0){
					$("#fileQueue").empty();
					$("#err").append(strs[0]);
				}else{
					$("#litpic").attr("value",strs[1]);
					$("#litpicover dd").remove();
					$("#litpicover").css("display","block");
					$("#litpicover").append("<dd><img src='"+strs[1]+"' height='50' /></dd>");
				}
		}
	});
	$("#moldst").empty();
	$("#moldst").append($("#mid").attr("value")+'/');
	$("#mid").change(function(){
		$("#moldst").empty();
		$("#moldst").append($("#mid").attr("value")+'/');
		<?php if($postgo=='add'){ ?>
		if($("#mid").attr("value")=='message'&&$("#msubmit").attr("value")==0){
			$("#msubmit").val(-1);
		}
		<?php } ?>
	});
});

///提交
function checkmyform()
{
	var rewriteroot = $('#id_childrendir').val();
	if(rewriteroot=='')
	{
		alert('子文件静态目录不能为空');
		return false;
	}
}

</script>
</head>
<body>
<div class="maintop">当前位置：<?php echo $toptxt ?></div>
<div class="main">
<ul class="switchs"><li id="s1">基本设置</li><li id="s2" class="c">栏目介绍</li><li id="s3" class="c">高级设置</li></ul>
	<div class="info">
    <form action="?c=<?php echo $Get_c; ?>&a=<?php echo $postgo ?>&run=1" method="post" onsubmit="return checkmyform();">
    <input name="tid" type="hidden" value="<?php echo $carray['tid'] ?>" />
    <div id="infos1">
    <dl style="border:0;"><dt>所属频道：</dt><dd>
    <select name="molds" id="mid">
        <?php foreach($moldsop as $v){ ?>
        <option value="<?php echo $v['molds']; ?>" <?php if($carray['molds']==$v['molds'] || $mm==$v['molds']){echo 'selected="selected"';}?>><?php echo $v['moldname']; ?></option>
        <?php } ?>
    </select>
    </dd></dl>
    <dl><dt>上级栏目：</dt><dd>
    <select name="pid">
        <option value="0" <?php if($carray=='' || $carray['fid']==0){echo 'selected="selected"';}?>>作为顶级栏目</option>
        <?php foreach($typesdb as $v){ if($auser->checkclass($v['tid'])){?>
        <option value="<?php echo $v['tid']; ?>" <?php if($carray['pid']==$v['tid'] || $ptid==$v['tid']){echo 'selected="selected"';}?>><?php if($v['n']>0){echo '|';}echo str_repeat('—',$v['n']).$v['name']; ?></option>
        <?php }} ?>
    </select>
    </dd></dl>
    <dl><dt>栏目名称：</dt><dd><input name="classname" type="text" class="int" value="<?php echo $carray['classname'] ?>" /></dd><dd>排序：</dd><dd><input name="orders" type="text" class="int" style="width:30px;" value="<?php if($carray!=''){echo $carray['orders'];}else{echo '0';} ?>" /></dd><dd class="t">越大越靠前</dd></dl>
    <dl><dt>栏目SEO标题：</dt><dd><input name="title" type="text" class="int" value="<?php echo $carray['title'] ?>" /></dd><dd class="t">显示于页面 meta title</dd></dl>
    <dl><dt>栏目SEO关键词：</dt><dd><input name="keywords" type="text" class="int" value="<?php echo $carray['keywords'] ?>" /></dd><dd class="t">显示于页面 meta keywords</dd></dl>
    <dl><dt>子文件静态目录：</dt><dd><input name="childrendir" type="text" id="id_childrendir" class="int" value="<?php echo $carray['childrendir'];?>" /></dd><dd class="t">目录下，“/”代表根目录</dd></dl>
    <dl><dt>栏目简介：</dt><dd><textarea name="description" class="int" style="width:300px; height:50px;"><?php echo $carray['description'] ?></textarea></dd><dd class="t">显示于页面 meta description</dd></dl>
    <dl><dt>默认栏目首页：</dt><dd>
<label><input type="radio" name="isindex" value="1" <?php if($carray=='' || $carray['isindex']=='1'){echo 'checked="checked"';} ?> />
<strong>栏目列表(文字)</strong>(显示所有内容文字格式列表)</label><br />
<label><input type="radio" name="isindex" value="2" <?php if($carray['isindex']=='2'){echo 'checked="checked"';} ?> />
<strong>栏目列表(图片)</strong>(显示所有内容图片格式列表)</label><br />
<label><input type="radio" name="isindex" value="3" <?php if($carray['isindex']=='3'){echo 'checked="checked"';} ?> />
<strong>栏目介绍</strong>(显示栏目介绍)</label><br />
<label><input type="radio" name="isindex" value="0" <?php if($carray['isindex']=='0'){echo 'checked="checked"';} ?> />
<strong>栏目聚合</strong>(显示下级栏目聚合)</label></dd></dl>
	<dl><dt>是否菜单显示：</dt><dd><label><input name="mshow" type="radio" value="1"<?php if($carray['mshow']==1 || $carray=='')echo ' checked="checked"' ?> />是</label> <label><input type="radio" name="mshow" value="0"<?php if($carray['mshow']==0 && $carray!='')echo ' checked="checked"' ?> />否</label></dd><dd class="t">是否在菜单显示，主要用于页头菜单调用</dd></dl>
	<dl><dt>底部导航显示：</dt><dd><label><input name="bottomnav" type="radio" value="1"<?php if($carray['bottomnav']==1 || $carray=='')echo ' checked="checked"' ?> />是</label> <label><input type="radio" name="bottomnav" value="0"<?php if($carray['bottomnav']==0 && $carray!='')echo ' checked="checked"' ?> />否</label></dd><dd class="t">是否在底部导航显示，主要用于页脚菜单调用</dd></dl>
    </div>
    <div id="infos2" style="display: none;">
    <dl style="border:0;"><dt>栏目介绍：</dt><dd><textarea name="body" class="xheditor  {html5Upload:false,upLinkUrl:'!admin.php?c=uploads&a=loadup&fileover=2&isfiles=filedata',upImgUrl:'!admin.php?c=uploads&a=loadup&fileover=2&multi=1&isfiles=filedata&fileExt=*.jpg;*.jpeg;*.gif;*.png',upFlashUrl:'!admin.php?c=uploads&a=loadup&fileover=2&isfiles=filedata',upMediaUrl:'!admin.php?c=uploads&a=loadup&fileover=2&isfiles=filedata'}" style="width:auto; height:350px;"><?php echo $carray['body'] ?></textarea></dd></dl>
    </div>
    <div id="infos3" style="display: none;">
    <dl style="border:0;"><dt>栏目链接：</dt><dd><input name="gourl" type="text" class="int" value="<?php echo $carray['gourl'] ?>" /></dd><dd class="t">填写栏目链接后，栏目将作为外部链接直接跳转自此地址</dd></dl>
    <?php if(funsinfo('member','isshow')==1){ ?>
    <dl><dt>访问权限：</dt><dd><select name="mrank">
      <option value="0">全部开放</option>
      <?php foreach($member_group as $v){ ?>
      <option value="<?php echo $v['gid'] ?>"<?php if($carray['mrank']==$v['gid']){echo ' selected="selected"';}?>><?php echo $v['name'] ?></option>
      <?php } ?>
    </select></dd><dd class="t">选择后，只有大于等于此权限用户才可访问</dd></dl>
    <dl><dt>投稿权限：</dt><dd><select name="msubmit" id="msubmit">
      <option value="0">禁止投稿</option>
      <option value="-1"<?php if($carray['msubmit']==-1){echo ' selected="selected"';}?>>游客</option>
      <?php foreach($member_group as $v){ ?>
      <option value="<?php echo $v['gid'] ?>"<?php if($carray['msubmit']==$v['gid']){echo ' selected="selected"';}?>><?php echo $v['name'] ?></option>
      <?php } ?>
    </select></dd><dd class="t">选择后，只有大于等于此权限用户才可投稿</dd></dl>
    <?php }else{ ?><input name="mrank" type="hidden" value="0" /><input name="msubmit" type="hidden" value="0" /><?php } ?>
    <dl id="litpicover" class="fileover" style="<?php if($carray['litpic']!='')echo 'display:block;';?>"><dt>&nbsp;</dt><?php if($carray['litpic']!=''){echo '<dd><img src="'.$carray['litpic'].'" height="50" /></dd>';} ?></dl>
    <dl><dt>栏目缩略图：</dt><dd><input name="litpic" id="litpic" type="text" class="int" value="<?php echo $carray['litpic'] ?>" /></dd><dd><input name="files" id="files" type="file" /></dd><dd id="err"></dd><dd id="fileQueue"></dd></dd></dl>
    
    <dl><dt>列表调用条数：</dt><dd><input name="listnum" type="text" class="int" style="width:30px;" value="<?php if($carray!=''){echo $carray['listnum'];}else{echo '20';} ?>" /></dd><dd class="t">栏目列表默认调用条数</dd></dl>
    <dl><dt>&nbsp;</dt><dd class="t">以下模板放于<?php echo '/template/'.syExt('view_themes').'/'; ?><span id="moldst"></span>目录中,留空以频道\上级栏目模板为准</dd></dl>
    <dl><dt>聚合模板：</dt><dd><input name="t_index" type="text" class="int" value="<?php echo $carray['t_index']; ?>" /></dd></dl>
    <dl><dt>列表模板(文字)：</dt><dd><input name="t_list" type="text" class="int" value="<?php echo $carray['t_list']; ?>" /></dd></dl>
    <dl><dt>列表模板(图片)：</dt><dd><input name="t_listimg" type="text" class="int" value="<?php echo $carray['t_listimg']; ?>" /></dd></dl>
    <dl><dt>介绍模板：</dt><dd><input name="t_listb" type="text" class="int" value="<?php echo $carray['t_listb']; ?>" /></dd></dl>
    <dl><dt>内容模板：</dt><dd><input name="t_content" type="text" class="int" value="<?php echo $carray['t_content']; ?>" /></dd></dl>
    <dl><dt>批量设置：</dt><dd><input name="t_all" type="checkbox" value="1" /> 覆盖所有下级栏目模板设置</dd></dl>
    </div>
    <dl><dt>&nbsp;</dt><dd><input type="submit" value="提 交" class="btnbig" /></dd></dl>
    </form>
    </div>
</div>
</body>
</html>
