westdc-zf1/application/default/views/scripts/author/metadata.phtml

76 lines
3.3 KiB
PHTML

<?php
$this->headTitle($this->config->title->site);
$this->headTitle($this->config->title->author);
$this->headTitle()->setSeparator(' - ');
$this->theme->AppendPlus($this,'jquery');
$this->theme->AppendPlus($this,'jquery_ui');
$this->theme->AppendPlus($this,'colorbox');
$this->headLink()->appendStylesheet('/css/author.css');
$this->headLink()->appendStylesheet('/css/author-metadata.css');
$this->breadcrumb('<a href="/">首页</a>');
$this->breadcrumb('<a href="/author">'.$this->config->title->author.'</a>');
$this->breadcrumb('新建数据');
$this->breadcrumb()->setSeparator(' > ');
?>
<div class="row">
<div class="span3">
<?= $this->partial('author/navi.phtml'); ?>
</div>
<div class="span9">
<div>
<ul class="nav nav-pills">
<li><a href="/author/newdata">未提交数据列表</a></li>
<li><a class="iframe" href="/service/geonetwork?url=metadata.xmlinsert.form">导入元数据</a></li>
<li><a href="/author/newdata/ac/add-by-template">根据模板新建元数据</a></li>
<li><a href="/author/newdata/ac/add-by-data">根据已有数据新建元数据</a></li>
<li class="active"><a href="/author/metadata">新建元数据</a></li>
</ul>
</div>
<div>
<ul class="unstyled">
<?php if(!empty($this->MDList)) { ?>
<?php foreach($this->MDList as $k=>$v) { ?>
<li class="well" id="item_<?= $v['id'] ?>"><p><a href="/author/metadata/ac/new/uuid/<?= $v['uuid']?>"><?= $v['content']->title ?></a></p>
<p>[ 状态:<?= $v['status']==0 ? "草稿":"已提审"?> | <a href="/author/metadata/ac/new/uuid/<?= $v['uuid']?>">修改</a> |
<a href="javascript:void(0);" onclick="del(<?= $v['id'] ?>,'<?= $v['uuid']?>')" id="delBtn_<?= $v['id'] ?>">删除</a> ]</p></li>
<?php }?>
<li><p><a href="/author/metadata/ac/new"> + 添加新元数据</a></p></li>
<?php }else{ ?>
<li><p>您还没有新元数据,<a href="/author/metadata/ac/new">点击这里添加</a></p></li>
<?php } ?>
</ul>
</div>
</div>
</div>
<!-- //页面内容 -->
<script>
$('#wapper').width($('body').width()-300);
function del(id,uuid){
var dom = "#delBtn_"+id;
var html = $(dom).html();
$.ajax({
'type':"POST",
'url':'/author/metadata/ac/del/uuid/'+uuid,
'data':'aid='+id,
'success':function(data){
if (typeof(data)=='object')
{
if(typeof(data.error)!='undefined')
{Alert(data.error);return false;}
if(typeof(data.deleted)!='undefined')
{$('#item_'+id).fadeOut(function(){$(this).remove();});}
}
else{
Alert('出现错误,请稍后再试');
}
},
'timeout': 30000,
'error': function(){Alert('处理中出现错误,请刷新页面后重试');},
'beforeSend':function(){$(dom).html('<img src="/images/ajax-load-small.gif" />');$(dom).attr("disabled","disabled")},
'complete':function(){$(dom).html(html);$(dom).removeAttr("disabled");dom = null;}
});
}
function Alert(content){
$.colorbox({innerWidth:'40%',html:'<div style="line-height:30px;font-size:16px;">'+ content +'</div>'});
}
</script>