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

95 lines
3.7 KiB
PHTML
Raw Normal View History

<?php
$this->headTitle($this->config->title->site);
$this->headTitle($this->config->title->author);
$this->headTitle()->setSeparator(' - ');
$this->theme->AppendPlus($this,'colorbox');
$this->headScript()->appendFile('/static/js/uploadify/swfobject.js');
$this->headScript()->appendFile('/static/js/uploadify/jquery.uploadify.v2.1.4.min.js');
$this->headLink()->appendStylesheet('/static/js/uploadify/uploadify.css');
$this->headLink()->appendStylesheet('/css/author.css');
$this->breadcrumb('<a href="/">首页</a>');
$this->breadcrumb('<a href="/author">数据作者</a>');
$this->breadcrumb('数据文献管理');
$this->breadcrumb()->setSeparator(' > ');
?>
<div class="row">
<div class="span3">
<?= $this->partial('author/navi.phtml'); ?>
</div>
<div class="span9">
<?= $this->partial('author/literature-nav.phtml',array('ac'=>$this->ac,'uuid'=>$this->uuid)); ?>
<p>请输入元数据关键字进行搜索</p>
<div class="input-append">
<form id="datasearch" class="search_form" action="">
<input type="text" id="keyword" name="q" value="<?php if(!empty($this->q)) echo $this->q; ?>" />
<button type="submit" class="btn" id="search_btn">搜索</button>
</form>
</div>
<div>
<?php if (count($this->paginator)): ?>
<ul class='unstyled'>
<?php
if($this->page > 1)
{
$autoindex = ($this->page - 1) * $this->pagelimit;
}else{
$autoindex=0;
}
foreach ($this->paginator as $item):
$autoindex++;
?>
<li class="well" id="list_<?php echo $item['uuid'];?>">
<h4><?= $autoindex ?>. <a href="/data/<?php echo $item['uuid'];?>" target="_blank"><?php echo $item['title'];?></a></h4>
【 共推荐文献<?php echo $item['c'];?>篇 |
<?php if ($item['c']>0) :?><a href="/author/literature/uuid/<?php echo $item['uuid'];?>">查看相关文献</a>
| <?php endif; ?>
<a href="/author/literature/ac/add/uuid/<?php echo $item['uuid'];?>" class="more iframe">添加文献</a>
</li>
<?php endforeach;
echo "</ul>";
endif; ?>
<div class="pagenavi"><?= $this->paginator; ?></div>
</div>
</div>
</div>
<script>
function action(ac,uuid){
$.ajax({
'type':"POST",
'url':'/author/literature/',
'data':'ac='+ ac +'&uuid='+uuid,
'success':function(data){
if (typeof(data)=='object')
{
if(typeof(data.error)!='undefined')
{$.colorbox({'innerWidth':'50%','html':data.error});}
if(typeof(data.deleted)!='undefined')
{$('#list_'+data.deleted).fadeOut("slow",function(){$(this).remove();});}
if(typeof(data.commited)!='undefined')
{window.location.reload();}
}
else{
$.colorbox({'innerWidth':'50%','html':'<img src="/images/alert_big_warning.png" /><h4>出现错误,请稍候再试</h4>'});
}
},
'timeout': 30000,
'error': function(){
$.colorbox({'innerWidth':'50%','html':'<img src="/images/alert_big_error.png" /><h4>处理中出现错误,请刷新页面后重试</h4>'});
}
});
}
$(".iframe").colorbox({iframe:true, width:"60%", height:"80%"});
$(".inline").colorbox({inline:true, width:"50%"});
function commit(id){
action('add&ref='+$('#ref').val()+'&reftype='+$('#reftype').val(),id);
}
</script>
<div class="colorbox" style="display:none;">
<div class="error"><img src="/images/alert_big_error.png" /><span></span></div>
<div class="ok"><img src="/images/alert_big_ok.png" /><span></span></div>
<div class="warning"><img src="/images/alert_big_warning.png" /><span></span></div>
</div>