westdc-zf1/application/admin/views/scripts/news/newsadd.phtml

211 lines
6.8 KiB
PHTML
Raw Normal View History

2011-09-23 07:34:40 +00:00
<?php
$this->headTitle($this->config->title->site);
$this->headTitle('后台管理');
$this->headTitle()->setSeparator(' - ');
$this->headScript()->appendFile('/static/js/jquery.tagInput.min.js');
$this->headScript()->appendFile('/static/js/kindeditor-min.js');
$this->headScript()->appendFile('/static/js/kindlang/zh_CN.js');
$this->headLink()->appendStylesheet('/static/css/kindskin/default/default.css');
2011-10-09 10:15:50 +00:00
?>
<?php
$auth = Zend_Auth::getInstance();
if($auth->hasIdentity())
{
$user = $auth->getIdentity();
$uname=$user->username;
$realname = $user->realname;
}
2011-09-23 07:34:40 +00:00
?>
<script type="text/javascript">
/* sample tags */
var tags=[
2011-10-09 10:15:50 +00:00
{tag:"冻土",freq:30},{tag:"寒旱所",freq:25}, {tag:"大气",freq:10},{tag:"高原",freq:4},
{tag:"西部",freq:3},{tag:"地理",freq:8}, {tag:"环境",freq:3},{tag:"地质",freq:20}
2011-09-23 07:34:40 +00:00
];
$(document).ready(function(){
/* setup navigation, content boxes, etc... */
Administry.setup();
KindEditor.ready(function(K) {
2011-10-09 10:15:50 +00:00
editor=K.create('textarea[name="body"]', {
2011-09-23 07:34:40 +00:00
cssPath : '/static/js/plugins/code/prettify.css',
uploadJson : '/plugins/upload_json.php',
fileManagerJson : '/plugins/file_manager_json.php',
allowFileManager : true
});
});
2011-10-09 10:15:50 +00:00
2011-09-23 07:34:40 +00:00
/* tag input field */
2011-10-09 10:15:50 +00:00
$("#keyword").tagInput({
2011-09-23 07:34:40 +00:00
tags:tags,
//jsonUrl:"tags.json",
sortBy:"frequency",
suggestedTags:["冻土", "寒旱所", "大气", "高原", "西部", "环境"],
tagSeparator:",",
autoFilter:true,
autoStart:false,
//suggestedTagsPlaceHolder:$("#suggested"),
boldify:true
});
});
</script>
<!-- Page title -->
<div id="pagetitle">
<div class="wrapper">
<h1>新闻中心</h1>
<!-- Quick search box -->
<form action="" method="get"><input class="" type="text" id="q" name="q" /></form>
</div>
</div>
<!-- End of Page title -->
<!-- Page content -->
<div id="page">
<!-- Wrapper -->
<div class="wrapper">
<!-- Right column/section -->
<aside class="column width2 first">
<?= $this->partial('news/left.phtml'); ?>
<div class="content-box">
<header>
<h3>新闻标签</h3>
</header>
<section>
输入Tag标签多个用半角逗号 “ , ”隔开每个Tag标签长度小于6个汉字
2011-10-09 10:15:50 +00:00
<p><textarea id="keyword" class="small full" name="keyword"></textarea></p>
2011-09-23 07:34:40 +00:00
</section>
</div>
</aside>
<!-- End of Right column/section -->
<!-- Left column/section -->
<section class="column width6">
<h3>发布新闻</h3>
2011-10-09 10:15:50 +00:00
<form name="form" id="archivesadd" method="post" action="#">
2011-09-23 07:34:40 +00:00
<fieldset>
<legend>新闻信息</legend>
2011-10-10 06:30:51 +00:00
<input type="hidden" id="image" class="half title" value="" name="image"/>
2011-09-23 07:34:40 +00:00
<p>
<label class="required" for="producttitle">标题</label><br/>
<input type="text" id="producttitle" class="half title" value="" name="title"/>
</p>
2011-10-09 10:15:50 +00:00
<p>
<label class="required" for="writer">作者</label><br/>
<input type="text" id="writer" class="half title" value="<?php echo $realname;?>" name="writer"/>
</p>
<p>
<label for="source" class="required">来源</label><br/>
<input type="text" id="source" class="half title" value="中国西部环境与生态科学数据中心" name="source"/>
</p>
<p>
<label for="description">内容简介(描述)</label><br/>
<textarea id="description" class="small half" name="description"></textarea>
</p>
2011-09-23 07:34:40 +00:00
<p>
2011-10-09 10:15:50 +00:00
<label for="body">新闻内容</label><br/>
<textarea id="body" class="large full" name="body"></textarea>
2011-09-23 07:34:40 +00:00
</p>
2011-10-09 10:15:50 +00:00
2011-09-23 07:34:40 +00:00
<div class="clearfix leading">
<div class="column width3 first">
<p>
2011-10-09 10:15:50 +00:00
<label for="type" class="required">新闻栏目</label><br/>
<select id="type" class="full" name="typeid">
<option value="0">请选择栏目</option>
2011-09-23 07:34:40 +00:00
<?php
foreach($this->types as $v)
{
2011-10-09 10:15:50 +00:00
echo '<option value="'.$v['id'].'">'.$v['title'].'</option>';
2011-09-23 07:34:40 +00:00
}
?>
</select>
<small>e.g. 研究成果</small>
</p>
<p><a href="/admin/news/catlog/add/1" target="_blank">+ 添加新栏目</a></p>
2011-10-09 10:15:50 +00:00
<p>
<select id="pub" class="full" name="pub">
<option value="1">立即发布</option>
<option value="0">存草稿</option>
<option value="-1">不发布</option>
</select>
</p>
2011-09-23 07:34:40 +00:00
</div>
<div class="column width3">
<p>
2011-10-09 10:15:50 +00:00
<input type="checkbox" id="pubtimeturn" name="pubtimer" value="1" /><label id="pubtimelable" for="productcat">定时发布?</label><br/>
2011-10-10 06:30:51 +00:00
<input type="text" name="pubtime" id="pubtime" value="<?php echo date("Y-m-d H:i",time()+3600*24);?>" readonly="readonly" />
2011-10-09 10:15:50 +00:00
<small>e.g. 2011-10-28 9:35 or 2011-10-28 21:35</small>
2011-09-23 07:34:40 +00:00
</p>
</div>
</div>
2011-10-09 10:15:50 +00:00
<div id="return"></div>
<p class="box"><input type="button" onclick="addon();" id="submit" class="btn btn-green big" value="提交"/> or <input type="reset" class="btn" value="重置"/></p>
2011-09-23 07:34:40 +00:00
</fieldset>
</form>
</section>
<!-- End of Left column/section -->
</div>
<!-- End of Wrapper -->
</div>
<!-- End of Page content -->
2011-10-09 10:15:50 +00:00
<script type="text/javascript">
$(function(){
$('#nav_news').addClass("current");
$("#pubtimeturn").click( function () {
if($(this).is(":checked"))
{
$('#pubtimelable').html('定时发布时间');
2011-10-10 06:30:51 +00:00
$('#pubtime').removeAttr('readonly');
2011-10-09 10:15:50 +00:00
}
else
{
$('#pubtimelable').html('定时发布?');
2011-10-10 06:30:51 +00:00
$('#pubtime').attr("readonly","readonly");
2011-10-09 10:15:50 +00:00
}
});
});
function addon(){
editor.sync();
var url = "/admin/news/archivesadd";
var data = $("#archivesadd").serialize()+'&keyword='+$('#keyword').val();
$.ajax({
type: "POST",
url: url,
data: data,
success: function(html){
$('#return').html(html);
},
beforeSend:function(){
$('#submit').val('正在提交...');
$('#submit').attr("disabled","disabled");
},
complete:function(){
$('#submit').val('提交');
$('#submit').removeAttr('disabled');
}
});
}
2011-09-23 07:34:40 +00:00
</script>