2011-09-30 08:48:49 +00:00
<?php
$this->headTitle($this->config->title->site);
$this->headTitle($this->config->title->data);
2011-10-30 09:01:02 +00:00
$this->headTitle($this->metadata->title);
2011-09-30 08:48:49 +00:00
$this->headTitle()->setSeparator(' - ');
$this->headLink()->appendStylesheet('/css/watermdview.css');
$this->breadcrumb('< a href = "/" > 首页< / a > ');
$this->breadcrumb('< a href = "/data" > '.$this->config->title->data.'< / a > ');
$this->breadcrumb('查看元数据');
$this->breadcrumb()->setSeparator(' > ');
2011-11-08 06:13:09 +00:00
//$this->headScript()->appendFile('https://maps.google.cn/maps?file=api&v=2&key='.$this->config->google->maps->api);
2011-11-05 15:25:58 +00:00
$this->headScript()->appendFile('/js/jquery-1.7.min.js');
$this->headScript()->appendFile('/js/jquery.colorbox-min.js');
2011-09-30 08:48:49 +00:00
$this->headLink()->appendStylesheet('/js/theme/default/style.css');
2011-11-05 15:25:58 +00:00
$this->headLink()->appendStylesheet('/css/colorbox.css');
2011-12-06 08:25:54 +00:00
$this->headScript()->appendFile('/js/jquery.idTabs.min.js');
2011-09-30 08:48:49 +00:00
?>
<?php $md = $this -> metadata ; if ( $md ) : ?>
< h1 > <?php echo $this -> escape ( $md -> title );
if ($md->title_en) echo '< br / > '.$this->escape($md->title_en);?>
< / h1 >
< div id = "right" >
< div id = "ItemSummary" >
< div id = "category" >
< ul > <?php foreach ( $this -> category as $cat ) : ?>
2011-10-24 12:30:39 +00:00
< li >< a href = "/data/category/code/ <?php echo $cat -> code ; ?> " > <?php echo $this -> escape ( $cat -> name_zh ); ?> </ a ></ li >
2011-09-30 08:48:49 +00:00
<?php endforeach ; ?>
< / ul >
< / div >
<?php
$kt='';
$i=0;
foreach($this->keys as $cg) :
2011-10-24 12:30:39 +00:00
if ($kt==$cg->keytype) :
2011-09-30 08:48:49 +00:00
$i+=1;
else :
if (!empty($kt)) echo '< / ul > < / div > ';
2011-10-24 12:30:39 +00:00
$kt=$cg->keytype;
2011-09-30 08:48:49 +00:00
$i=0;
endif;
2011-10-24 12:30:39 +00:00
if ($i==0) echo '< div id = "'.$cg->keytype.'" > < ul > ';
echo '< li > < a href = "/data/tag/key/'.urlencode($cg->keyword).'" > '.$cg->keyword.'< / a > < / li > ';
2011-09-30 08:48:49 +00:00
endforeach;
echo '< / ul > < / div > ';
?>
<!--
<?php if ( $this -> series ) : ?>
< div id = "series" >
< ul > <?php foreach ( $this -> series as $serie ) : ?>
2011-10-24 12:30:39 +00:00
< li >< a href = "/data/series/id/ <?php echo $serie -> id ; ?> " > <?php echo $this -> escape ( $serie -> name ); ?> </ a ></ li >
2011-09-30 08:48:49 +00:00
<?php endforeach ; ?>
< / ul >
< / div >
<?php endif ; ?>
-->
< ul id = OtherInfo >
<?php if ( $md -> fileformat ) : ?>
< li id = "fileformat" > 格式:<?php echo $md -> fileformat ; ?> </ li >
<?php endif ; ?>
< li id = "filesize" > 大小:<?php echo $md -> filesize ; ?> MB</ li >
<?php if ( $this -> downloaded > 9 ) : ?>
< li id = "downtimes" > 下载:<?php echo $this -> downloaded ; ?> 次</ li >
<?php endif ; ?>
< li id = "viewtimes" > 浏览:<?php echo $this -> viewed ; ?> 次</ li >
<!--
<?php if ( $md -> projection ) : ?>
< li id = "projection" title = " <? = $this -> projection ; ?> " > 数据投影:
<?php
$p=explode(" ",$this->projection);
$p=explode("=",$p[0]);
if (!empty($p[1]))
echo $p[1];
else
{
if (is_numeric($md->projection)) echo 'EPSG_CODE_';
echo $md->projection;
}
?>< / li >
<?php endif ; ?>
-->
<?php if ( ! empty ( $md -> timebegin )) : ?>
< li id = "datatimes" > 数据时间范围:<?php echo date ( 'Y-m-d' , strtotime ( $md -> timebegin )); if ( ! empty ( $md -> timeend )) echo " 至 " . date ( 'Y-m-d' , strtotime ( $md -> timeend )); ?> </ li >
<?php endif ; ?>
<?php if ( ! empty ( $this -> doc )) : ?>
< li id = "datadoc" >< a href = " <?php $wikiTitle = $this -> doc ;
if(strpos($wikiTitle,'http://wiki.westgis.ac.cn/index.php/')!==false){
$title=str_replace('http://wiki.westgis.ac.cn/index.php/','',$wikiTitle);
echo "/metainfo/$title";
}else{
echo $this->doc;
}?>">数据说明文档< / a > < / li >
2011-11-28 02:55:54 +00:00
<?php endif ; ?>
<?php if ( $this -> attachments ) : ?>
< li class = "attach" > 相关文档:
<?php foreach ( $this -> attachments as $k => $a ) : ?>
< a href = "/service/attach/id/ <?php echo $a -> id ; ?> " title = " <?php echo $a -> realname ; ?> " > <?php echo ( $k + 1 ); ?> </ a >
<?php endforeach ; ?>
< a href = "/service/attach/zip/ <?php echo $md -> uuid ; ?> " >< img src = "/images/zip_icon.gif" title = "打包下载" /></ a >
< / li >
2011-09-30 08:48:49 +00:00
<?php endif ; ?>
2011-11-02 08:13:31 +00:00
< li id = "datatype" > 数据共享方式:<?php if ( $md -> datatype ) print "离线" ; else print "在线(可直接下载)" ; ?> < a href = "javascript:void(0);" id = "show-list" onclick = "getFileList()" title = "" > 文件列表</ a ></ li >
2011-09-30 08:48:49 +00:00
< / ul >
2011-10-28 03:18:44 +00:00
< div id = "linkurl" >
<?php if ( $md -> status > 0 and $md -> status < 5 ) : ?>
2011-10-24 15:31:18 +00:00
< a href = "/review/review/uuid/ <?php echo $md -> uuid ; ?> " >< img src = "/images/review.png" title = "此数据正在评审中,我们邀请您对此数据进行评审,以便其能尽快发布!" /></ a >
<?php else : if ( ! $md -> datatype ) : ?>
2011-11-02 08:13:31 +00:00
< a href = "javascript:$('#todownload').show();todownload(1);" > < img src = "/images/download.png" title = "直接下载" / > < / a >
2011-09-30 08:48:49 +00:00
<?php endif ; ?>
< a href = "/data/order/uuid/ <?php echo $md -> uuid ; ?> " >< img src = "/images/order.png" title = "免费!离线申请此数据(在线数据和离线数据都可申请)" /></ a >
2011-10-28 03:18:44 +00:00
<?php endif ; ?>
2011-09-30 08:48:49 +00:00
< / div >
< / div >
< hr / >
< h2 > 空间位置< / h2 >
< div id = 'watermap' > < / div >
< hr / >
< h2 > 联系信息< / h2 >
< div id = "authors" >
< ul >
<?php
$party_zh=array('resourceProvider'=>'资源提供者','custodian'=>'维护者','owner'=>'拥有者','user'=>'用户','distributor'=>'数据服务联系人','originator'=>'创建者','pointOfContact'=>'联系人','principalInvestigator'=>'数据调查与处理者','processor'=>'处理者','publisher'=>'元数据发布者','author'=>'元数据作者');
$r='';
$i=0;
foreach($this->authors as $k=>$author) :
2011-10-24 12:30:39 +00:00
if ($author->role!=$r)
2011-09-30 08:48:49 +00:00
{
2011-10-24 12:30:39 +00:00
$r=$author->role;
2011-09-30 08:48:49 +00:00
$i=0;
if ($k>0) echo '< / li > ';
2011-10-24 12:30:39 +00:00
echo '< li > '.$party_zh[$author->role].': ';
2011-09-30 08:48:49 +00:00
}
if ($i>0) echo ', ';
$i+=1;
2011-10-24 12:30:39 +00:00
if (!empty($author->email) & & $r!='principalInvestigator')
echo '< a href = "mailto:'.$author->email.'" > ';
echo '< strong title = "'.$author->organisation.'" > ';
if (!empty($author->individual))
echo $author->individual;
2011-09-30 08:48:49 +00:00
else
2011-10-24 12:30:39 +00:00
echo $author->organisation;
2011-09-30 08:48:49 +00:00
echo '< / strong > ';
2011-10-24 12:30:39 +00:00
if (!empty($author->email)) echo '< / a > ';
2011-09-30 08:48:49 +00:00
if ($k+1==count($this->authors)) echo '< / li > ';
endforeach;
?>
< / ul >
< hr / >
< ul >
< li > 元数据更新时间:<?php print date ( 'Y-m-d' , strtotime ( $md -> ts_created )); ?> < a href = "/data/xml/uuid/ <?php echo $md -> uuid ; ?> " >< img src = "/images/xml.gif" alt = "查看XML源文件" ></ a >< a href = "/data/doc/uuid/ <?php echo $md -> uuid ; ?> " >< img src = "/images/doc-icon.png" alt = "Word doc格式" ></ a ></ li >
<!--<li><a href="/data/detail/id/ <?php echo $md -> id ; ?> ">详细元数据</a></li>-->
< / ul >
< / div >
< / div >
2011-11-23 07:52:49 +00:00
< div id = "left" >
2011-11-05 15:25:58 +00:00
< div id = "ImageViewer" >< a class = "colorbox" title = " <?php echo $md -> title ; ?> " href = "/service/bigthumb/uuid/ <?php echo $md -> uuid ; ?> " >< img src = "/service/thumb/uuid/ <?php echo $md -> uuid ; ?> " /></ a ></ div >
2011-09-30 08:48:49 +00:00
< div id = "abstract" >
< p >
<?php echo str_replace ( array ( " \r\n " , " \n " , " \r " ), '</p><p>' , $md -> description ); ?>
< / p >
< / div >
< hr / >
< div id = "cite" >
<?php if ( $md -> citation ) : ?>
< h2 > 本数据引用方式< / h2 >
< p > <?php echo $this -> escape ( $md -> citation ); ?> </ p >
<?php endif ; ?>
<?php if ( $this -> ref ) : ?>
< h2 > 建议参考文献< / h2 >
< ol >
<?php foreach ( $this -> ref as $ref ) :
2011-10-24 12:36:02 +00:00
if (empty($ref->link))
echo '< li > '.$ref->reference.'< / li > ';
2011-09-30 08:48:49 +00:00
else
2011-10-24 12:36:02 +00:00
echo '< li > '.$ref->reference.' < a href = "'.$ref->link.'" > 下载< / a > < / li > ';
2011-09-30 08:48:49 +00:00
endforeach;
?>
< / ol >
<?php endif ; ?>
< h2 > 数据使用声明< / h2 >
<?php
if ($this->uselimits) :
foreach($this->uselimits as $uselimit) :
2011-10-24 12:30:39 +00:00
echo '< p > '.str_replace(array("\r\n", "\n", "\r"),'< / p > < p > ',$this->escape($uselimit->uselimit)).'< / p > ';
2011-09-30 08:48:49 +00:00
endforeach;
?>
<?php else : ?>
< p > 为尊重知识产权、保障数据作者的权益、扩展数据中心的服务、评估数据的应用潜力,请数据使用者在使用数据所产生的研究成果中(包括公开发表的论文、论著、数据产品和未公开发表的研究报告、数据产品等成果),明确注明数据来源和数据作者。对于转载(二次或多次发布)的数据,作者还须注明原始数据来源。< / p >
< p > 中文发表的成果参考以下规范注明: 数据来源于国家自然科学基金委员会"中国西部环境与生态科学数据中心"(http://westdc.westgis.ac.cn)< / p >
< p > 英文发表的成果依据以下规范注明: The data set is provided by Environmental and Ecological Science Data Center for West China,National Natural Science Foundation of China (http://westdc.westgis.ac.cn)< / p >
< / p >
<?php endif ; ?>
<?php if ( $md -> suppinfo ) : ?>
< h2 > 项目支持信息< / h2 >
<?php echo '<p>' . str_replace ( array ( " \r\n " , " \n " , " \r " ), '</p><p>' , $this -> escape ( $md -> suppinfo )) . '</p>' ; ?>
<?php endif ; ?>
<?php if ( $this -> resources ) : ?>
< h2 > 其他在线资源< / h2 >
< ul > <?php foreach ( $this -> resources as $link ) : ?>
2011-10-24 12:30:39 +00:00
< li >< a href = " <?php echo $link -> linkage ; ?> " title = " <?php echo $link -> description ; ?> " >
2011-09-30 08:48:49 +00:00
<?php
2011-10-24 12:30:39 +00:00
if (!empty($link->name))
echo $link->name;
elseif (!empty($link->description))
echo $link->description;
2011-09-30 08:48:49 +00:00
else
2011-10-24 12:30:39 +00:00
echo $link->linkage;
2011-09-30 08:48:49 +00:00
?>< / a > < / li >
<?php endforeach ; ?>
< / ul >
<?php endif ; ?>
< / div >
2011-12-06 08:25:54 +00:00
<?php
$keywords = array();
foreach($this->keys as $cg){
if($cg->keytype=="theme")
$keywords[]=$cg->keyword;
}
$ev = join(" ",$keywords);
?>
< ul class = "idTabs" >
< li > < a href = "#related" id = "related_t" > 相关数据< / a > < / li >
< li > < a href = "#literature" id = "literature_t" > 相关文献< / a > < / li >
< li > < a href = "#gsearch" class = "googlesearch" > 相关搜索< / a > < / li >
< li > < a href = "#service" > 服务记录< / a > < / li >
< li > < a href = "#recommend" id = "recommend_t" > 给我推荐< / a > < / li >
2011-09-30 08:48:49 +00:00
< / ul >
2011-12-06 08:25:54 +00:00
< div id = "related" >
2011-09-30 08:48:49 +00:00
< / div >
< div id = "literature" >
< / div >
2011-12-06 08:25:54 +00:00
< div id = "gsearch" >
< ul id = "searchctrl" >
< li > < a href = "javascript:;" class = "googlesearch" > Google搜索< / a > < / li >
< li > < a href = "javascript:;" class = "bingsearch" > BING搜索< / a > < / li >
< li > < a href = "javascript:;" class = "scholar" > Google学术搜索< / a > < / li >
< li > < a href = "javascript:;" class = "cnkiSearch" > CNKI学术搜索< / a > < / li >
< / ul >
< ul id = "searchlist" >
2011-09-30 08:48:49 +00:00
< / ul >
< / div >
2011-12-06 08:25:54 +00:00
< div id = "service" >
<?php if ( $this -> downhistory ) : ?>
< p > 最近10条服务记录如下: < / p >
< ol start = "1" >
<?php
foreach($this->downhistory as $v){
echo '< li > '.date("Y-m-d",strtotime($v->ts_created))." ".$v->unit." ".$v->realname;
if (!empty($v->offlineproject))
echo ' 用途:'.$v->offlineproject;
elseif (!empty($v->onlineproject))
echo ' 用途:'.$v->onlineproject;
echo '< / li > ';
}
?>
< / ol >
<?php else : ?>
暂时没有服务记录,欢迎您下载使用!
2011-09-30 08:48:49 +00:00
<?php endif ; ?>
2011-12-06 08:25:54 +00:00
< / div >
< div id = "recommend" >
< / div >
2011-09-30 08:48:49 +00:00
< hr / >
2011-10-28 03:18:44 +00:00
< div id = "comments" >
<?php if ( $md -> status > 0 and $md -> status < 5 ) : ?>
< p class = "strong" > 此数据还在评审过程中,我们真切地邀请您参加此数据的评审,以便我们能尽快发布此数据!< a href = "/review/review/uuid/ <?php echo $md -> uuid ; ?> " >< img src = "/images/review.png" title = "此数据正在评审中,我们邀请您对此数据进行评审,以便其能尽快发布!" /></ a ></ p >
<?php else : ?>
2011-09-30 08:48:49 +00:00
< h2 > 数据评论< / h2 >
< div id = "allcomments" >
2011-10-28 03:18:44 +00:00
< div id = "loading" > < img src = "/images/loading.gif" / > 评论加载中< / div >
2011-09-30 08:48:49 +00:00
< / div >
2011-11-23 08:12:29 +00:00
<?php
$auth = Zend_Auth::getInstance();
if($auth->hasIdentity())
{
$user = $auth->getIdentity();
$name = $user->realname;
$email = $user->email;
}else
{
$name = "";
$email = "";
}
?>
2011-11-23 07:52:49 +00:00
< form id = "postcommentform" >
< p >
< label class = "required" style = "background:none;" > 姓名< / label >
2011-11-23 08:12:29 +00:00
< input type = "text" name = "author" value = " <?php echo $name ; ?> " />
2011-11-23 07:52:49 +00:00
< / p >
< p >
< label class = "required" style = "background:none;" > EMAIL< / label >
2011-11-23 08:12:29 +00:00
< input type = "text" name = "email" value = " <?php echo $email ; ?> " />
2011-11-23 07:52:49 +00:00
< / p >
< p >
< label > WEBSITE< / label >
2011-11-23 08:12:29 +00:00
< input type = "text" name = "url" value = "" / > < small > e.g. http://westdc.westgis.ac.cn/< / small >
2011-11-23 07:52:49 +00:00
< / p >
< p >
< label class = "required" style = "background:none;" > 内容< / label >
< textarea name = "content" class = "medium half" > < / textarea >
< / p >
< p >
2011-12-29 08:09:58 +00:00
< label class = "required" > 验证码< / label >
< img id = "imgcode" style = "margin-bottom:-10px;cursor:pointer;border:0px;" src = "/service/imgcode/" onClick = "this.src=this.src+'?'" > < input type = "text" name = "vdcode" id = "vdcode" maxlength = "4" value = "" / >
< / p >
< p >
2011-11-23 07:52:49 +00:00
< label > < / label >
< input type = "hidden" name = "mdtitle" value = " <?php echo $md -> title ; ?> " />
< input type = "hidden" name = "uuid" value = " <?php echo $md -> uuid ; ?> " />
< a class = "btn btn-green" id = "postcomment" href = "javascript:;" onclick = "postcomment();" > 提交< / a > < button type = "reset" id = "reset" class = "btn" > 重置< / button > < span id = "returninfo" > < / span >
< / p >
< / form >
< div id = "infobox" > < / div >
2011-10-24 15:31:18 +00:00
<?php endif ; ?>
2011-09-30 08:48:49 +00:00
< / div >
< / div >
2011-11-28 02:55:54 +00:00
< div >
< / div >
2011-09-30 08:48:49 +00:00
< div id = "window-outter" style = "display:none;" >
< div id = "window-inner" >
2011-11-02 08:13:31 +00:00
< div id = "window-closer-container" > [< a href = "#" id = "window-closer" onclick = "$('#window-outter').hide()" > 关闭< / a > ]< / div >
2011-09-30 08:48:49 +00:00
< div id = "window-content-container" >
< div id = "window-loading" > 加载中...< / div >
< ol id = "file-list" >
< / ol >
< / div >
< / div >
< / div >
2011-11-02 08:13:31 +00:00
2011-09-30 08:48:49 +00:00
< div id = "todownload" style = "display:none;" >
2011-11-02 08:13:31 +00:00
< div class = "closeox" > < a href = "javascript:void(0);" onclick = "$('#todownload').hide()" > [关闭]< / a > < / div >
2011-11-23 07:52:49 +00:00
< div id = "formcontent" style = "" >
2011-09-30 08:48:49 +00:00
< / div >
< / div >
2011-11-23 07:52:49 +00:00
< script type = "text/javascript" charset = "utf-8" >
$(document).ready(function(){$(".colorbox").colorbox({photo:"true"});});
$(window).bind("load", function() { var timeout = setTimeout(function() { initLoader(); }, 100);});
//$(window).bind("load", function() { var timeout = setTimeout(function() { gmaploaded(); }, 1000);});
function loadMaps() {
google.load("maps", "2", {"callback" : gmaploaded,"base_domain": "ditu.google.cn"});
}
function initLoader() {
var script = document.createElement("script");
script.src = "https://www.google.com/jsapi?key=<?php echo $this -> config -> google -> maps -> api ; ?> &callback=loadMaps";
script.type = "text/javascript";
document.getElementsByTagName("head")[0].appendChild(script);
2011-11-08 06:13:09 +00:00
}
2011-09-30 08:48:49 +00:00
//ajax download
function todownload(ft)
{
2011-11-02 08:13:31 +00:00
var url = "/data/todownload/uuid/<?php echo $md -> uuid ; ?> /ft/"+ft;
if($('#todownloadform')) var date = $('#todownloadform').serialize();
$.ajax({
type:"GET",
url:url,
data:date,
success:function(html){
2011-11-23 07:52:49 +00:00
$('#formcontent').html(html);
2011-11-02 08:13:31 +00:00
},
beforeSend:function(){
2011-11-23 07:52:49 +00:00
$('#formcontent').html('< img src = "/images/11887177066.gif" / > ');
2011-11-02 08:13:31 +00:00
}
2011-09-30 08:48:49 +00:00
});
}
2011-11-23 07:52:49 +00:00
2011-12-06 08:25:54 +00:00
//ajax comment
function ajaxpage(page){$.ajax({type:"GET",url:"/data/comment/uuid/<? = $md -> uuid ; ?> ",data:'page='+page,success:function(html){$('#allcomments').html(html);},
beforeSend:function(){$('#allcomments').html('< img src = "/images/loading.gif" / > 加载中');}});};ajaxpage(0);
function postcomment(){ $.ajax({'type':"POST",'url':"/data/postcomment",'data':$('#postcommentform').serialize(),
2011-12-29 08:09:58 +00:00
'success':function(html){$('#postcomment').html('提交');setTimeout("$('#postcomment').removeAttr('disabled');",3000);$('#returninfo').html(html);},
2011-12-06 08:25:54 +00:00
'beforeSend':function(){$('#postcomment').attr('disabled','disabled');$('#postcomment').html('< img src = "/images/11887177066.gif" / > 正在提交...'); }});}
$('#literature_t').click(function(){literature(1);});
//ajax literature
function literature(page){$.ajax({type:"GET",url:"/service/literature/uuid/<? = $md -> uuid ; ?> ",data:'page='+page,success:function(html){$('#literature').html('< ol start = "'+ ((page-1)*10+1) +'" > '+html+'</ ol > ');},
beforeSend:function(){$('#literature').html('< img src = "/images/loading.gif" / > 加载中');}});}
$('#related_t').click(function(){related(1);});
//ajax related
function related(page){$.ajax({type:"GET",url:"/service/related/uuid/<? = $md -> uuid ; ?> ",data:'page='+page,success:function(html){$('#related').html('< ol start = "'+ ((page-1)*10+1) +'" > '+html+'</ ol > ');},
beforeSend:function(){$('#related').html('< img src = "/images/loading.gif" / > 加载中');}});};related(1);
2011-12-07 05:30:00 +00:00
$('#recommend_t').click(function(){recommend(0);});
2011-12-06 08:25:54 +00:00
//ajax recommend
function recommend(page){$.ajax({type:"GET",url:"/service/recommend/uuid/<? = $md -> uuid ; ?> ",data:'page='+page,success:function(html){$('#recommend').html('< ul > '+html+'</ ul > ');},
beforeSend:function(){$('#recommend').html('< img src = "/images/loading.gif" / > 加载中');}});}
2011-09-30 08:48:49 +00:00
//ajax comment
2011-11-23 07:52:49 +00:00
ajaxpage(0);
2011-10-28 03:18:44 +00:00
function ajaxpage(page){
2011-11-02 08:13:31 +00:00
var url = "/data/comment/uuid/<? = $md -> uuid ; ?> ";
data='page='+page;
$.ajax({
type:"GET",
url:url,
data:data,
success:function(html){$('#allcomments').html(html);},
beforeSend:function(){$('#allcomments').html('< img src = "/images/loading.gif" / > 评论加载中');}
});
2011-11-23 07:52:49 +00:00
};
function postcomment(){
var url="/data/postcomment";
var date = $('#postcommentform').serialize();
$.ajax({
'type':"POST",
'url':url,
'data':date,
'success':function(html){
$('#postcomment').html('提交');
setTimeout("$('#postcomment').removeAttr('disabled');",3000);
$('#returninfo').html(html);
ajaxpage(0);
},
'beforeSend':function(){
$('#postcomment').attr('disabled','disabled');
$('#postcomment').html('< img src = "/images/11887177066.gif" / > 正在提交...');
}
});
}
2011-11-02 08:13:31 +00:00
function getFileList(){
var tw = ($(window).width() - $('#window-outter').width())/2;
$('#window-outter').css({'right':tw});
$('#window-outter').show();
2011-11-27 08:18:12 +00:00
$.getJSON("/service/filelist/uuid/<?php echo $md -> uuid ; ?> ", function(data) {
2011-11-02 08:13:31 +00:00
var items = [];
if(data.length>0)
{
$.each(data, function(key, val) {
if(val['filename'].match(/\/$/))
{
items.push('< li id = "li_' + val['id'] + '" > < span id = "span_'+val['id']+'" > +< / span > < a href = "javascript:;" id = "taget_'+val['id']+'" onclick = "getSubFileList(\'' +val['uuid']+ '\',\''+val['id']+'\',\''+val['depth']+'\')" > ' + val['filename'] + '< / a > < / li > ');
}else{
items.push('< li id = "li_' + val['id'] + '" > ' + val['filename'] + '< / li > ');
}
});
}else{
items.push('< li > 暂无数据< / li > ');
}
$('#file-list').html(items.join(''));
})
.complete(function() {$('#window-loading').hide();});
}
function getSubFileList(uuid,id,depth){
if($("#div_"+id).length>0)
{
$('#span_'+id).html('+');
$("#div_"+id).remove();
return false;
}
$('< div / > ', {
2011-11-27 08:18:12 +00:00
'style':'max-height:400px; overflow:auto; overflow-x:hidden;',
2011-11-02 08:13:31 +00:00
'id': 'div_'+id,
2011-11-27 08:18:12 +00:00
"html": '< li > < img src = "/images/loading.gif" / > 加载中< / li > '
2011-11-02 08:13:31 +00:00
}).appendTo('#li_'+id);
2011-11-27 08:18:12 +00:00
url="/service/subfilelist/uuid/"+uuid+"/subpath/"+id+"/depth/"+depth;
2011-11-02 08:13:31 +00:00
$.getJSON(url, function(data) {
var items = [];
$.each(data, function(key, val) {
if(val['filename'].match(/\/$/))
{
items.push('< li id = "li_' + val['id'] + '" > < span id = "span_'+val['id']+'" > +< / span > < a href = "javascript:;" id = "taget_'+val['id']+'" onclick = "getSubFileList(\'' +val['uuid']+ '\',\''+val['id']+'\',\''+val['depth']+'\')" > ' + val['filename'] + '< / a > < / li > ');
}else{
items.push('< li id = "' + key + '" > ' + val['filename'] + '< / li > ');
}
});
$("#div_"+id).html(items.join(''));
}).complete(function(){
if($("#div_"+id)){
$('#span_'+id).html('-');
}
});
2011-11-23 07:52:49 +00:00
}
2011-12-06 08:25:54 +00:00
$('.googlesearch').click(function(){googleSearch('<?php echo $ev ; ?> ');});
$('.bingsearch').click(function(){bingSearch('<?php echo $ev ; ?> ');});
$('.cnkiSearch').click(function(){cnkiSearch('<?php echo $ev ; ?> ');});
$('.scholar').click(function(){scholarSearch('<?php echo $ev ; ?> ');});
function googleSearch(keyword){
$.ajax({type:"POST",url:"/service/googlesearch",data:'q='+keyword,
success:function(html){
var items = [];
var obj = jQuery.parseJSON(html);
$.each(obj.responseData.results, function(key, val) {
var html = '< p > < a href = "' +val['unescapedUrl']+'" > '+val['title']+'< a / > < / p > < p > < span > '
+val['url'].replace(/%(.*)/i,"") +'< / span > < / p > < p > '
+val['content']
+'< / p > ';
items.push('< li > ' + html + '< / li > ');
});
items.push('< li class = "more" > < a href = "'+obj.responseData.cursor.moreResultsUrl+'" target = "_blank" > 查看更多搜索结果(约'+obj.responseData.cursor.estimatedResultCount+'条)< / a > < / div > ');
$('#searchlist').html(items.join(''));
$('html, body').animate({scrollTop:$('#searchlist').offset().top}, 'slow');
},
beforeSend:function(){$('#searchlist').html('< img src = "/images/loading.gif" / > 结果加载中');}
});
}
function scholarSearch(keyword){
$.ajax({type:"POST",url:"/service/scholarsearch",data:'q='+keyword,
success:function(html){
//$('#searchlist').html(html);return false;
var items = [];
var obj = jQuery.parseJSON(html);
if(obj.error != '')
{
items.push('< li > ' + obj.error + '< / li > ');
}else{
$.each(obj.result, function(key, val) {
var html = val['title']
+'< p > '
+val['content']
+'< / p > ';
items.push('< li > ' + html + '< / li > ');
});
}
items.push('< li class = "more" > < a href = "'+obj.morelink+'" target = "_blank" > 查看更多搜索结果< / a > < / div > ');
$('#searchlist').html(items.join(''));
$('html, body').animate({scrollTop:$('#searchlist').offset().top}, 'slow');
},
beforeSend:function(){$('#searchlist').html('< img src = "/images/loading.gif" / > 结果加载中');}
});
}
function bingSearch(keyword){
$.ajax({type:"POST",url:"/service/bingsearch",data:'q='+keyword,
success:function(html){
var items = [];
var obj = jQuery.parseJSON(html);
2011-12-19 07:45:29 +00:00
if(obj.SearchResponse.Web.Total==0)
{$('#searchlist').html("No results!");return false;}
2011-12-06 08:25:54 +00:00
$.each(obj.SearchResponse.Web.Results, function(key, val) {
var html = '< p > < a href = "' +val['Url']+'" > '+val['Title']+'< a / > < / p > < p > < span > '
+val['DisplayUrl'].replace(/%(.*)/i,"") +'< / span > < / p > < p > '
+val['Description']
+'< / p > ';
items.push('< li > ' + html + '< / li > ');
});
items.push('< li class = "more" >< a href = "http://cn.bing.com/search?q= <?php echo urlencode ( $ev ); ?> &go=&qs=n&sk=&form=QBLH" target = "_blank" > 查看更多搜索结果(约'+obj.SearchResponse.Web.Total+'条)</ a ></ div > ');
$('#searchlist').html(items.join(''));
$('html, body').animate({scrollTop:$('#searchlist').offset().top}, 'slow');
},
beforeSend:function(){$('#searchlist').html('< img src = "/images/loading.gif" / > 结果加载中');}
});
}
function cnkiSearch(keyword){
$.ajax({type:"POST",url:"/service/cnkisearch",data:'q='+keyword,
success:function(html){
var items = [];
var obj = jQuery.parseJSON(html);
if(obj.error != '')
{
items.push('< li > ' + obj.error + '< / li > ');
}else{
$.each(obj.result, function(key, val) {
var html = '< p > < a href = "' +val['url']+'" target = "_blank" > '+val['title']+'< / a > < / p > < p > < span > '
+val['url'].replace(/%(.*)/i,"") +'< / span > < / p > < p > '
+val['content']
+'< / p > ';
items.push('< li > ' + html + '< / li > ');
});
}
items.push('< li class = "more" > < a href = "'+obj.morelink+'" target = "_blank" > 查看更多搜索结果< / a > < / div > ');
$('#searchlist').html(items.join(''));
$('html, body').animate({scrollTop:$('#searchlist').offset().top}, 'slow');
},
beforeSend:function(){$('#searchlist').html('< img src = "/images/loading.gif" / > 结果加载中');}
});
}
2011-11-23 07:52:49 +00:00
function gmaploaded()
{
2011-11-02 08:13:31 +00:00
//google map
var map = new GMap2(document.getElementById("watermap"));
var plotbounds=new GLatLngBounds(new GLatLng(<? = $md -> south ; ?> ,<? = $md -> west ; ?> ),new GLatLng(<? = $md -> north ; ?> ,<? = $md -> east ; ?> ));
var zoomlevel=map.getBoundsZoomLevel(plotbounds);
zoomlevel--;
2011-09-30 08:48:49 +00:00
<?php if ( $md -> north == $md -> south ) : ?>
2011-11-02 08:13:31 +00:00
zoomlevel=10;
2011-09-30 08:48:49 +00:00
<?php endif ; ?>
if (zoomlevel>16) zoomlevel=16;
map.setCenter(new GLatLng(<? = ( $md -> south + $md -> north ) / 2 ; ?> ,<? = ( $md -> east + $md -> west ) / 2 ; ?> ), zoomlevel);
2011-11-08 06:13:09 +00:00
map.setMapType(G_HYBRID_MAP);
2011-09-30 08:48:49 +00:00
map.setUIToDefault();
<?php if ( $md -> north == $md -> south ) : ?>
var marker=new GMarker(new GLatLng(<? = $md -> north ; ?> ,<? = $md -> east ; ?> ));
map.addOverlay(marker);
<?php else : ?>
var polygon=new GPolygon([
new GLatLng(<? = $md -> north ; ?> ,<? = $md -> west ; ?> ),
new GLatLng(<? = $md -> north ; ?> ,<? = $md -> east ; ?> ),
new GLatLng(<? = $md -> south ; ?> ,<? = $md -> east ; ?> ),
new GLatLng(<? = $md -> south ; ?> ,<? = $md -> west ; ?> ),
new GLatLng(<? = $md -> north ; ?> ,<? = $md -> west ; ?> )
],"#f33f00",5,1,"#ff0000",0.2);
map.addOverlay(polygon);
2011-11-23 07:52:49 +00:00
<?php endif ; ?>
2011-11-08 06:13:09 +00:00
}
2011-09-30 08:48:49 +00:00
< / script >
<?php else : ?>
< p > Cannot find the metadata.< / p >
< p > 没有找到对应的元数据。< / p >
<?php endif ; ?>