2012-03-29 09:12:47 +00:00
<?php
$this->headTitle($this->config->title->site);
$this->headTitle($this->config->title->author);
$this->headTitle()->setSeparator(' - ');
2013-03-27 09:06:23 +00:00
$this->theme->AppendPlus($this,'colorbox');
2013-05-06 09:01:14 +00:00
$this->theme->AppendModel($this,"author-literature");
2013-03-27 09:06:23 +00:00
$this->headLink()->appendStylesheet('/css/author.css');
2012-05-18 13:14:52 +00:00
$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');
2014-09-02 13:06:16 +00:00
$this->breadcrumb('< a href = "/" > Home< / a > ');
$this->breadcrumb('< a href = "/author" > Author< / a > ');
$this->breadcrumb('Literatures');
2012-03-29 09:12:47 +00:00
$this->breadcrumb()->setSeparator(' > ');
?>
2013-03-27 09:06:23 +00:00
< div class = "row" >
< div class = "span3" >
<? = $this -> partial ( 'author/navi.phtml' ); ?>
2012-03-29 09:12:47 +00:00
< / div >
2013-03-27 09:06:23 +00:00
< div class = "span9" >
2014-09-02 05:20:24 +00:00
<? = $this -> partial ( 'author/literature-nav.phtml' , array ( 'ac' => $this -> ac , 'uuid' => $this -> uuid )); ?>
2014-09-02 13:06:16 +00:00
< h4 > Dataset: < a href = "/data/ <? = $this -> uuid ?> " > <? = $this -> paginator -> getItem ( 0 )[ 'mdtitle' ] ?> </ a ></ h4 >
< p > Search by keywords in the title of literatures or < a href = "/author/literature/ac/add/uuid/ <?php echo $this -> uuid ; ?> " class = "more iframe btn" > Add literatures for the dataset</ a ></ p >
2014-09-02 05:20:24 +00:00
< 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 ; ?> " />
2014-09-02 13:06:16 +00:00
< button type = "submit" class = "btn" id = "search_btn" > Search and link the literatures< / button >
2014-09-02 05:20:24 +00:00
< / form >
2013-03-27 09:06:23 +00:00
< / div >
< div >
2014-09-02 05:20:24 +00:00
<?php if ( count ( $this -> paginator )) : ?>
< ul class = 'unstyled' >
<?php
if($this->page > 1)
{
$autoindex = ($this->page - 1) * $this->pagelimit;
}else{
$autoindex=0;
}
2013-03-27 09:06:23 +00:00
foreach ($this->paginator as $item):
2014-09-02 05:20:24 +00:00
$autoindex++;
?>
2013-03-27 09:06:23 +00:00
< li class = "well" id = "list_ <?php echo $item [ 'id' ] . $item [ 'uuid' ]; ?> " >
2014-09-02 05:20:24 +00:00
< p >< strong > <? = $this -> referenceType [ $item [ 'reftype' ]] ?> </ strong > <? = $autoindex ?> . <?php echo $item [ 'reference' ]; ?> </ p >
2013-05-06 09:01:14 +00:00
< p >
2014-09-02 13:06:16 +00:00
[ < a href = "/knowledge/paper/id/ <?php echo $item [ 'id' ]; ?> " > View</ a >
| < a href = "javascript:;" onclick = "showdata(' <?php echo $item [ 'id' ]; ?> ',0)" >< i class = "icon-external-link text-success" ></ i > Datasets related with the literature</ a >
2014-09-02 05:20:24 +00:00
<?php if ( $item [ 'reftype' ] == 0 ) : ?>
2014-09-02 13:06:16 +00:00
| < a href = "javascript:void(0);" class = "order" rel = " <? = $item [ 'mrid' ]; ?> " rev = " <? = $item [ 'place' ] ?> " > Place</ a >
| < a onclick = "return confirm('Sure to remove the literature?');" href = "javascript:action('remove&id= <?php echo $item [ 'mrid' ]; ?> ',' <?php echo $item [ 'uuid' ]; ?> ');" class = "more" > Remove</ a >
2014-09-02 05:20:24 +00:00
<?php endif ; ?>
2014-09-02 13:06:16 +00:00
]< / p >
2013-03-27 09:06:23 +00:00
< / li >
<?php endforeach ;
echo "< / ul > ";
endif; ?>
< div class = "pagenavi" > <? = $this -> paginator ; ?> </ div >
< / div >
2012-03-29 09:12:47 +00:00
< / div >
< / div >
< script >
2014-09-02 05:20:24 +00:00
function showdata(id,page){
var url="/service/refdatalist/id/"+id;
$.ajax({
'type':"GET",
'url':url,
'data':'page='+page,
'dataType':'html',
'success':function(html){$.colorbox({'html':html,'innerHeight':230});}
});
}
2012-03-29 09:12:47 +00:00
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 > '});
}
});
2013-03-27 09:06:23 +00:00
}
$(".iframe").colorbox({iframe:true, width:"60%", height:"80%"});
$(".inline").colorbox({inline:true, width:"50%"});
2012-03-29 09:12:47 +00:00
function commit(id){
action('add&ref='+$('#ref').val()+'&reftype='+$('#reftype').val(),id);
}
2013-03-27 09:06:23 +00:00
< / script >
2012-03-29 09:12:47 +00:00
< 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 >