<!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="source/admin/template/style/admin.css" rel="stylesheet" type="text/css" />
<script src="include/js/jsmain.js" type="text/javascript"></script>
<script src="include/js/DatePicker/WdatePicker.js" type="text/javascript"></script>
<script charset="utf-8" src="include/js/kindeditor/kindeditor-min.js"></script>
<script charset="utf-8" src="include/js/kindeditor/lang/zh_CN.js"></script>
<script src="include/js/admin.js" type="text/javascript"></script>
<script type="text/javascript">
var editor;
KindEditor.ready(function(K) {
	editor = K.create('#body1', {
		cssPath : ['include/js/prettify.css'],
		fileManagerJson : '<?php echo $GLOBALS["G_DY"]["url"]["url_path_base"];?>?c=uploads&a=filemanager',
		allowFileManager : true,
		filePostName : 'editor_KindEditor',
		filterMode : false,
		uploadJson : '<?php echo $GLOBALS["G_DY"]["url"]["url_path_base"];?>?c=uploads&tid='+$("#tid").attr("value")+'&isfiles=editor_KindEditor'
	});
});
$(function(){
	$("#tid option[class='hidden']").remove();
	fieldsinfo();
	$("#tid").change(function(){
		fieldsinfo();
	});
	$("#submit").click(function(check){ 
		if($("#tid").val() == ''||$("#title").val() == ''){ 
			alert("请选择栏目和输入标题");  
			check.preventDefault();
		}else{
			<?php if(syExt('site_html')==1){ ?>
			winboxgo('<img src="include/js/jwcomupload/loading.gif" /> <strong>正在提交，并生成静态文件，请稍后...</strong>','b');
			<?php }else{ ?>
			if($("#all_down_images").attr('checked') == true){
				winboxgo('<img src="include/js/jwcomupload/loading.gif" /> <strong>正在下载远程图片，请稍后...</strong>','b');
			}
			<?php } ?>
			$("#submit").css("display","none");
		}
	}); 
});
function fieldsinfo(){
	$("#fieldsinfo").empty();
	$("#fieldsinfo").append("<dl><dt>&nbsp;</dt><dd><img src='include/js/jwcomupload/loading.gif' /></dd>");
	$.ajax({
		url: '?c=a_fields&a=info',type: 'post',
		//async:false,
		cache: false,
		data: "tid="+$("#tid").attr("value")+"&molds=<?php echo $molds;?>&id=<?php echo $carray['id'];?>",
		success: function(html){
			$("#fieldsinfo").empty();
			$("#fieldsinfo").append(html);
		}
	});
	$("#flitpic").attr("src","?c=uploads&a=loadup&inputid=litpic&fileExt=*.jpg;*.jpeg;*.gif;*.png&fileover=1&tid="+$("#tid").attr("value"));
}
function delfieldall(fieldid){
	$("#"+fieldid).remove();
}
</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></ul>
	<div class="info">
    <form action="?c=a_<?php echo $molds ?>&a=<?php echo $postgo ?>&run=1" method="post" id="gform">
    <input name="id" type="hidden" value="<?php echo $carray['id'] ?>" />
    <div id="infos1">
    <dl style="border:0;"><dt>所属栏目：</dt><dd><select name="tid" id="tid">
    	<option value=''>选择所属栏目</option>
        <?php foreach($typesdb as $v){ if($auser->checkclass($v['tid'])){?>
        <option value="<?php echo $v['tid']; ?>"<?php if($carray['tid']==$v['tid'] || $itid==$v['tid']){echo 'selected="selected"';}?><?php if($v['molds']!=$molds)echo ' class="hidden"' ?>><?php echo str_repeat('—',$v['n']).$v['name']; ?></option>
        <?php }} ?>
    </select>
    </dd></dl>
    <dl><dt>域名：</dt><dd><input name="title" id="title" type="text" class="int" value="<?php echo $carray['title'] ?>" style="width:300px;" /></dd></dl>

    <span id="fieldsinfo"></span>

    <dl><dt>含义：</dt><dd><textarea name="description" style="width:300px; height:30px;" class="int"><?php echo $carray['description'] ?></textarea></dd></dl>
    <?php if(!empty($traits)){ ?>
    <dl><dt>推荐属性：</dt><dd>
    <?php foreach($traits as $v){ ?>
    	<label><input name="trait[]" type="checkbox" value="<?php echo $v['id'] ?>" <?php if(strpos($carray['trait'],','.$v['id'].',')!==FALSE)echo 'checked="checked" '; ?>/><?php echo $v['name'] ?> </label>
    <?php } ?></dd><?php if($auser->checkgo('a_traits')){ ?><dd class="m"><a href="?c=a_traits&molds=article" target="_blank">[管理]</a></dd><?php } ?></dl>
    <?php } ?>
    <?php if($auser->checkgo('a_'.$molds,'audit')){ ?>
    <dl><dt>审核：</dt><dd><label><input name="isshow" type="radio" value="1"<?php if($carray['isshow']==1 || $carray=='')echo ' checked="checked"' ?> />已审</label> <label><input type="radio" name="isshow" value="0"<?php if($carray['isshow']==0 && $carray!='')echo ' checked="checked"' ?> />未审</label> </dd></dl>
    <?php }else{ ?><input name="isshow" type="hidden" value="<?php echo $auser->audit() ?>" /><?php } ?>
    </div>
    
    <div id="infos2" class="none">
    <dl style="border:0;"><dt>标题颜色：</dt><dd><select name="style1" onchange="select">
        	<option value="" >默认</option>
    	  	<option value="color:#CC0000;" style="color:#CC0000;" <?php if(strpos($carray['style'],'CC0000')!==FALSE)echo 'selected="selected"' ?>>红色</option>
            <option value="color:#0000FF;" style="color:#0000FF;" <?php if(strpos($carray['style'],'0000FF')!==FALSE)echo 'selected="selected"' ?>>蓝色</option>
            <option value="color:#009900;" style="color:#009900;" <?php if(strpos($carray['style'],'009900')!==FALSE)echo 'selected="selected"' ?>>绿色</option>
            <option value="color:#996600;" style="color:#996600;" <?php if(strpos($carray['style'],'996600')!==FALSE)echo 'selected="selected"' ?>>咖啡色</option>
            <option value="color:#8142BF;" style="color:#8142BF;" <?php if(strpos($carray['style'],'8142BF')!==FALSE)echo 'selected="selected"' ?>>紫色</option>
            <option value="color:#FF6600;" style="color:#FF6600;" <?php if(strpos($carray['style'],'FF6600')!==FALSE)echo 'selected="selected"' ?>>橘黄色</option>
        	</select></dd>
        <dd><strong>标题样式：</strong></dd><dd><select name="style2" onchange="select">
        	<option value="" >默认</option>
    	  	<option value="font-weight:bold;" <?php if(strpos($carray['style'],'bold')!==FALSE)echo 'selected="selected"' ?>>加粗</option>
            <option value="text-decoration:underline;" <?php if(strpos($carray['style'],'underline')!==FALSE)echo 'selected="selected"' ?>>下划线</option>
       	</select></dd></dl>
    <?php if($auser->checkgo('a_special') && !empty($specials)){ ?>
    <dl><dt>所属专题：</dt><dd><select name="sid" id="sid">
    	<option>选择所属专题</option>
        <?php foreach($specials as $v){?>
        <option value="<?php echo $v['sid']; ?>" <?php if($carray['sid']==$v['sid']){echo 'selected="selected"';}?>><?php echo $v['name']; ?></option>
        <?php } ?>
    </select></dd></dl>
    <?php }else{ ?><input name="sid" type="hidden" value="0" /><?php } ?>
    <dl><dt>排序：</dt><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>关键词：</dt><dd><input name="keywords" type="text" class="int" value="<?php echo $carray['keywords'] ?>" /></dd><dd class="t">请使用英文逗号“,”分割</dd></dl>
    <dl><dt>更新时间：</dt><dd><input name="addtime" type="text" class="int" value="<?php if($carray!=''){echo date('Y-m-d H:i',$carray['addtime']);}else{echo date('Y-m-d H:i');} ?>" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm'})" /></dd></dl>
    <dl><dt>点击次数：</dt><dd><input name="hits" type="text" class="int" value="<?php if($carray!=''){echo $carray['hits'];}else{echo '0';} ?>" /></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>
    <?php }else{ ?><input name="mrank" type="hidden" value="0" /><?php } ?>
    <?php if(funsinfo('pay','isshow')==1){ ?>
    <dl><dt>消耗现金：</dt><dd><input name="mgold" type="text" class="int" style="width:60px;" value="<?php if($carray!=''){echo $carray['mgold'];}else{echo '0.00';} ?>" /> 元</dd><dd class="t">设置后，只有注册用户可访问本内容，并扣除相应现金</dd></dl>
    <?php }else{ ?><input name="mgold" type="hidden" value="0" /><?php } ?>
    <dl><dt>外部链接：</dt><dd><input name="gourl" type="text" class="int" value="<?php echo $carray['gourl'] ?>" /></dd><dd class="t">填写后，访问本内容时直接跳转自此地址</dd></dl>
    <dl><dt>文件名：</dt><dd><input name="htmlfile" type="text" class="int" value="<?php echo $carray['htmlfile'] ?>" /></dd><dd class="t">生成静态及伪静态使用，格式如about，不要加后缀</dd></dl>
    </div>
    <dl><dt>&nbsp;</dt><dd><input type="submit" id="submit" value="提 交" class="btnbig" /></dd></dl>
    </form>
    </div>
</div>
</body>
</html>
