<?php require_once 'head.html';?>
        <div class="span9">
		  <div class="row-fluid">
			<div class="page-header">
				<h1>新文章 <small>Add New article</small></h1>
			</div>
			<form class="form-horizontal" action="?c=add_page" method="post">
				<fieldset>
					<div class="control-group">
						<label class="control-label" for="role" id="title">文章标题</label>
						<div class="controls">
							<input style="height:27.9861px;" name="title" type="text" class="input-xlarge" id="role" />
						</div>
					</div>
					<div class="control-group" id="type">
					<div id="c_con">
						<label class="control-label" for="description" id="contents">内容</label>
						</div>
						<div class="controls">

				 <div>
    <textarea name="content" id="editor" style="width:100%;height:300px;"></textarea>
</div>



						</div>
					
					<script type="text/javascript" src="Editor/getEditor.js"></script>
					</div>
					<div class="control-group">
						<label class="control-label" for="slug">资源链接</label>
						<div class="controls">
							<input style="height:27.9861px;" name="rlink" type="text" class="input-xlarge" id="slug" placeholder="可为空,用来做音乐地址或视频地址.."/>
						</div>
					</div>
					<div class="control-group">
						<label class="control-label" for="image_link">资源图片</label>
						<div class="controls">
							<input style="height:27.9861px;" name="image_link" type="text" class="input-xlarge" id="image_link" placeholder="可为空,音乐用来作为歌曲LOGO,视频作为列表显示的时候展示用.."/>
						</div>
					</div>
					<div id="rose"></div>
					
					<div class="control-group">
						<label class="control-label" for="slug">文章分类</label>
						<div class="controls">
							<select name="ify">
							<option value='0'>未分类</option>
							<?php foreach ($ify as $v){?>
							<option value='<?php echo $v['pid']?>'><?php echo $v['ify_name']?></option>
							<?php }?>
							</select>
						</div>
					</div>
					
					<div class="control-group">
						<label class="control-label" for="mend">文章推荐</label>
						<div class="controls">
							<input type="radio" name="mend" value="0" checked="checked">不推荐  &nbsp;
							<input type="radio" name="mend" value="1">推荐
						</div>
					</div>
					<script>
					function DelContent(){
						var art = document.getElementById('art');
						if (art.value!=='article' && art.value!=='images' && art.value!=='down'){
							var child = document.getElementById("contents");
							child.parentNode.removeChild(child);
							document.getElementById("type").className="";
						    UE.getEditor('editor').setHide();
						    document.getElementById('rose').innerHTML='<div id="top_rose"><div class="control-group"><label class="control-label" for="con_rose">备注信息</label><div class="controls"><textarea name="con_rose" style="width:100%;height:300px;" placeholder="如果是歌曲这里就填写歌曲的作者,如果是视频就写视频的信息或者介绍.."></textarea></div></div></div>';
						}else{
							document.getElementById("c_con").innerHTML='<label class="control-label" for="description" id="contents">内容</label>';  
							UE.getEditor('editor').setShow();
							document.getElementById("type").className="control-group";
							var childs = document.getElementById("top_rose");
							childs.parentNode.removeChild(childs);
						}
                         
					}
					</script>
					<div class="control-group">
						<label class="control-label" for="section">栏目类型</label>
						<div class="controls">
							<select name="section" onchange="DelContent();" id="art">
							<option value='article'>文章栏目</option>
							<option value='images'>图片栏目</option>
							<option value='video'>视频栏目</option>
							<option value='music'>音乐栏目</option>
							<option value='down'>下载栏目</option>
							</select>
						</div>
					</div>
					<div class="form-actions">
						<input name="add_article" type="submit" class="btn btn-success btn-large" value="发布文章" /> <a class="btn" href="?c=index">返回仪表盘</a>
					</div>					
				</fieldset>
			</form>
		  </div>
        </div>
      </div>

      <hr>

     <?php require_once 'foot.html';?>

    </div>

    <script src="Delivery/js/jquery.js"></script>
	<script src="Delivery/js/bootstrap.min.js"></script>
  </body>
</html>
