Add view-tianditu in WATER project

This commit is contained in:
wlx 2015-07-25 21:01:44 +08:00
parent 473015e755
commit 9c284068bb
1 changed files with 518 additions and 0 deletions

View File

@ -0,0 +1,518 @@
<?php
$this->headTitle($this->config->title->site);
$this->headTitle($this->config->title->data);
$this->headTitle($this->metadata->title);
$this->headTitle()->setSeparator(' - ');
$this->theme->AppendPlus($this,'tianditu');
$this->theme->AppendPlus($this,'colorbox');
if(!empty($this->dataService)) {
$this->theme->AppendModel($this,"dataservice");
}
?>
<style>
h3.gs_rt{font-size:110%;}
#file-list li:hover {background-color: #f5f5f5;}
#file-list li li:hover {background-color: #dedede;}
#file-list li li li:hover {background-color: #eeeeee;}
#watermap img {max-width:none;}
</style>
<?= $this->render('breadcrumbs.phtml'); ?>
<?php $md=$this->metadata;if ($md):?>
<h3><?php echo $this->escape($md->title);
if ($md->title_en) echo '<br />'.$this->escape($md->title_en);
if ($md->mdid) echo '<a class="pull-right btn btn-large btn-primary" href="http://westdc.westgis.ac.cn/data/'.$md->uuid.'"><i class="icon-external-link"></i> Chinese Version</a>';?>
</h3>
<hr />
<div class="row">
<div class="span8">
<div>
<a class="colorbox pull-right" title="<?php echo $md->title; ?>" href="/service/bigthumb/uuid/<?php echo $md->uuid; ?>"><img src="/service/thumb/uuid/<?php echo $md->uuid;?>"/></a>
<p style="word-break:break-word;word-wrap:break-word;overflow:hidden;">
<?php echo str_replace(array("\r\n", "\n", "\r"),'</p><p>',$md->description);?>
</p>
</div>
<div>
<?php if ($md->citation) : ?>
<hr />
<h4><i class="icon-quote-left muted"></i>Citation<a class="btn btn-danger pull-right" href="/archives/help/platform/archive-107.html" ><i class="icon-comment"></i>Help</a></h4>
<p><?php if (empty($md->datadoi) || !strpos($md->citation,$md->datadoi)) : ?>
<span class="label label-info">Paper Cite</span>
<?php endif; echo $this->escape($md->citation);
if (strpos($md->citation,$md->datadoi)) : ?>
(Download: <a href="/service/ris/lang/en/uuid/<?php echo $md->uuid; ?>">RIS</a> |
<a href="/service/bibtex/lang/en/uuid/<?php echo $md->uuid; ?>">Bibtex</a>)
<?php endif; ?>
</p>
<?php if (!empty($md->datadoi) && !strpos($md->citation,$md->datadoi)) : ?>
<p><span class="label label-info">Dataset Cite</span>
<?php echo str_replace('"','',substr($md->author_en,1,-1)).'. '.$md->title.'. '.$md->publisher_en.', '.(empty($md->ts_published)?$md->publish_year:date('Y',strtotime($md->ts_published))).'. doi:'.$md->doi; ?>
(Download: <a href="/service/ris/lang/en/uuid/<?php echo $md->uuid; ?>">RIS</a> |
<a href="/service/bibtex/lang/en/uuid/<?php echo $md->uuid; ?>">Bibtex</a>)</p>
<?php endif; endif; ?>
<?php if ($this->ref) : ?>
<hr />
<h4><i class="icon-eye-open text-success"></i>Related Publications (Recommended by Author)</h4>
<ol>
<?php foreach($this->ref as $ref) :
echo '<li>'.$ref->reference;
echo '<a href="/knowledge/paper/id/'.$ref->id.'"><i class="icon-info-sign text-success"></i>Detail</a>';
if (empty($ref->link))
{
if(!empty($ref->attid))
echo ' <a href="/service/attach/id/'.$ref->attid.'"><i class="icon-download text-success"></i>Download</a>';
}else{
echo ' <a href="'.$ref->link.'"><i class="icon-download text-success"></i>Download</a>';
}
echo "</li>";
endforeach;
?>
</ol>
<?php endif; if ($this->themeref) :?>
<hr />
<h4><i class="icon-eye-open text-success"></i>Special Publications</h4>
<ol>
<?php foreach($this->themeref as $ref) :
echo '<li>'.$ref->reference;
echo '<a href="/knowledge/paper/id/'.$ref->id.'"><i class="icon-info-sign text-success"></i>Detail</a>';
if (empty($ref->link))
{
if(!empty($ref->attid))
echo ' | <a href="/service/attach/id/'.$ref->attid.'"><i class="icon-download text-success"></i>Download</a>';
}else{
echo ' | <a href="'.$ref->link.'"><i class="icon-download text-success"></i>Download</a>';
}
echo "</li>";
endforeach;
?>
</ol>
<?php endif; if ($this->userref) : ?>
<hr />
<h4><i class="icon-eye-open text-success"></i>Cited By</h4>
<ol>
<?php foreach($this->userref as $ref) :
echo '<li>'.$ref->reference;
echo '<a href="/knowledge/paper/id/'.$ref->id.'"><i class="icon-info-sign text-success"></i>Detail</a>';
if (empty($ref->link))
{
if(!empty($ref->attid))
echo ' <a href="/service/attach/id/'.$ref->attid.'"><i class="icon-download text-success"></i>Download</a>';
}else{
echo ' <a href="'.$ref->link.'"><i class="icon-download text-success"></i>Download</a>';
}
echo "</li>";
endforeach;
if (count($this->userref)==15)
{
echo '<a class="btn btn-success pull-right" href="/knowledge/user/uuid/'.$md->uuid.'" ><i class="icon-info-sign"></i>More</a>';
}
?>
</ol>
<?php endif; ?>
<hr />
<h4><i class="icon-legal text-warning"></i>Limitations</h4>
<?php
if ($this->uselimits) :
foreach($this->uselimits as $uselimit) :
echo '<p>'.str_replace(array("\r\n", "\n", "\r"),'</p><p>',$this->escape($uselimit->uselimit)).'</p>';
endforeach;
?>
<?php endif; ?>
<?php if($this->data_archives){ ?>
<h4>Dataset News</h4>
<ul>
<?php
foreach($this->data_archives as $v){?>
<li><a href="<?= $v['url']['archive_url']?>"><?= $v['title']?></a></li>
<?php } ?>
</ul>
<hr />
<?php }?>
<?php if ($md->suppinfo || $this->fund) : ?>
<h4><i class="icon-money text-info"></i>Fund</h4>
<?php if(!empty($this->fund)) : ?>
<ul>
<?php foreach($this->fund as $k=>$v) : ?>
<li><?= $v['fund_type_en'] ?> (<a href="/data/fund/id/<?= $v['id']?>">No. <?= $v['fund_id']?></a>)</li>
<?php endforeach; ?>
</ul>
<?php elseif(!empty($md->suppinfo)) : ?>
<?php echo '<p>'.str_replace(array("\r\n", "\n", "\r"),'</p><p>',$this->escape($md->suppinfo)).'</p>';?>
<?php endif; ?>
<hr />
<?php endif; ?>
<?php if ($this->resources) : ?>
<h4><i class="icon-bolt text-warning"></i>Online Resources</h4>
<ul class="unstyled inline"><?php foreach($this->resources as $link) : ?>
<li><a class="label" href="<?php echo $link->linkage; ?>" title="<?php echo $link->description; ?>">
<?php
if (!empty($link->name))
echo $link->name;
elseif (!empty($link->description))
echo $link->description;
else
echo $link->linkage;
?></a></li>
<?php endforeach; ?>
</ul>
<hr />
<?php endif; ?>
</div>
<div>
<?php
$keywords = array();
foreach($this->keys as $cg){
if($cg['keytype']=="theme")
$keywords[]=$cg['keyword'];
}
$ev = join(" ",$keywords);
?>
<div class="tabbable"> <!-- Only required for left/right tabs -->
<ul class="nav nav-tabs">
<li><a href="#related" data-toggle="tab" id="related_t">Related Dataset</a></li>
<li><a href="#literature" data-toggle="tab" id="literature_t">Related Literatures</a></li>
<li><a href="#gsearch" data-toggle="tab" id="gsearch_t">Searching</a></li>
<li><a href="#recommend" data-toggle="tab" id="recommend_t">Recommendation</a></li>
</ul>
<div class="tab-content">
<div id="related" class="tab-pane">
</div>
<div id="literature" class="tab-pane">
<div id="literature-list">
</div>
</div>
<div id="gsearch" class="tab-pane">
<ul id="searchlist" class="unstyled well well-small"></ul>
</div>
<div id="recommend" class="tab-pane">
</div>
</div>
</div>
<!--
<hr />
<div id="comments">
<?php if ($md->status>0 and $md->status<5) : ?>
<p class="strong">This data is not published yet. You are invited to review this dataset, to make the data released as soon as possible.<a class="btn btn-primary" href="/review/review/uuid/<?php echo $md->uuid; ?>">评审</a></p>
<?php else : ?>
<h4>Comment</h4>
<div id="allcomments">
<div id="loading"><img src="/images/loading.gif" />Loading</div>
</div>
<?php
$auth = Zend_Auth::getInstance();
if($auth->hasIdentity())
{
$user = $auth->getIdentity();
$name = $user->realname;
$email = $user->email;
}else
{
$name = "";
$email = "";
}
?>
<form class="form-horizontal" id="postcommentform">
<div class="control-group">
<label class="control-label">Name</label>
<div class="controls">
<input type="text" name="author" value="<?php echo $name;?>" />
</div>
</div>
<div class="control-group">
<label class="control-label">Email</label>
<div class="controls">
<input type="text" name="email" value="<?php echo $email;?>" />
</div>
</div>
<div class="control-group">
<label class="control-label">Website</label>
<div class="controls">
<input type="text" name="url" value="" /> <span class="help-block">e.g. http://westdc.westgis.ac.cn/</span>
</div>
</div>
<div class="control-group">
<label class="control-label">Content</label>
<div class="controls">
<textarea name="content" class="span5"></textarea>
</div>
</div>
<div class="control-group">
<label class="control-label">Captcha</label>
<div class="controls">
<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="" />
</div>
</div>
<div class="control-group">
<div class="controls">
<input type="hidden" name="mdtitle" value="<?php echo $md->title;?>" />
<input type="hidden" name="uuid" value="<?php echo $md->uuid;?>" />
<a class="btn btn-primary" id="postcomment" href="javascript:;" onclick="postcomment();">Submit</a><button type="reset" id="reset" class="btn">Reset</button><span id="returninfo"></span>
</div>
</div>
</form>
<div id="infobox"></div>
<?php endif; ?>
</div> -->
</div>
</div>
<div class="span4">
<ul class="well well-small inline unstyled">
<li><a href="/data/category"><i class="icon-th text-warning"></i>Category: </a></li>
<?php foreach($this->category as $cat): ?>
<li><a href="/data/category/code/<?php echo $cat->code;?>"><i class="icon-th-large"></i><?php echo $this->escape($cat->name);?></a></li>
<?php endforeach; ?>
</ul>
<?php
$kw=array('discipline'=>'Discipline','place'=>'Place','theme'=>'Theme','temporal'=>'Temporal','stratum'=>'Stratum');
$kt='';
$i=0;
foreach($this->keys as $cg) :
if ($kt==$cg['keytype']) :
$i+=1;
else :
if (!empty($kt)) echo '</ul>';
$kt=$cg['keytype'];
$i=0;
endif;
if ($i==0) {
?>
<ul class="well well-small inline unstyled">
<li><a href="/data/tag/keytype/<?php echo $kt; ?>"><i class="icon-tags text-warning"></i><?php echo $kw[$kt]; ?></a></li>
<?
}
echo '<li><a href="/data/tag/key/'.urlencode($cg['keyword']).'"><i class="icon-tag"></i>'.$cg['keyword'].'</a></li>';
endforeach;
?></ul>
<?php if ($md->doi) : ?>
<ul class="well well-small inline unstyled"><li><span class="label label-success">DOI</span> <a href="http://dx.doi.org/<?php echo $md->doi; ?>"><?php echo $md->doi; ?></a></li></ul>
<?php endif; ?>
<div>
<hr />
<h4>Information<a class="btn pull-right" href="javascript:void(0);" id="show-list" title="" rel="<?= $md->uuid;?>"><i class="icon-file"></i>File list</a></h4>
<ul class="inline unstyled well">
<?php if ($md->fileformat) : ?>
<li><strong>File Format: </strong><?php echo $md->fileformat; ?></li>
<?php endif; ?>
<li><strong>Size: </strong><?php echo $md->filesize; ?>MB</li>
<?php if ($this->downloaded>9) :?>
<li><strong>Downloaded: </strong><?php echo $this->downloaded; ?></li>
<?php endif; ?>
<li><strong>Viewed: </strong><?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"><strong>Temporal Range: </strong><?php echo date('Y-m-d',strtotime($md->timebegin));if (!empty($md->timeend)) echo " to ".date('Y-m-d',strtotime($md->timeend)); ?></li>
<?php endif; ?>
<?php if ($this->attachments) : ?>
<li id="attach"><span>Documents: </span>
<?php foreach ($this->attachments as $k=>$a) : ?>
<a href="/service/attach/id/<?php echo $a->id; ?>" title="<?php echo $a->realname; ?>"><img src="/images/document.png"></a>
<?php endforeach; ?>
<a href="/service/attach/zip/<?php echo $md->uuid; ?>"><img src="/images/zip_icon.gif" title="打包下载"/></a>
</li>
<?php endif; ?>
<li id="datatype"><strong>Sharing: </strong><?php if ($md->datatype) print "Offline"; else print "Online";?> </li>
</ul>
<div id="linkurl">
<?php if ($md->status>0 and $md->status<5) : ?>
<a href="/review/review/uuid/<?php echo $md->uuid; ?>" class="btn btn-primary btn-large btn-block" title="You are invited to review this dataset.">Reviewing</a>
<?php else : if (!$md->datatype) : ?>
<a href="/data/todownload/?uuid=<?= $md->uuid?>" class="btn btn-primary btn-large btn-block" title="Download">
Download
</a>
<?php else: ?>
<?php
if(!empty($this->dataService)) { ?>
<?php if($this->dataService['service_type'] == 2) { ?>
<a href="javascript:void(0);" class="btn btn-primary btn-large btn-block" title="Select the subset" onclick="westdc.dataservice.choiceData('<?= $md->uuid ?>',this);">
<?php }else if($this->dataService['service_type'] == 3) {?>
<a href="#selectDataWindow" role="button" class="btn btn-primary btn-large btn-block" data-toggle="modal">
<?php } ?>
<?php }else{ ?>
<a href="/data/order/uuid/<?php echo $md->uuid; ?>" class="btn btn-primary btn-large btn-block" title="Free of Charge!">
<?php } ?>
Put in the Basket
</a>
<?php endif;endif; ?>
</div>
</div>
<hr />
<h4>Map</h4>
<div id='watermap' style="width:100%;height:300px;"></div>
<hr />
<h4>Contacts</h4>
<div id="authors">
<ul class="unstyled">
<?php
$party_zh=array('resourceProvider'=>'Resource Provider','custodian'=>'Custodian','owner'=>'Owner','user'=>'User','distributor'=>'Distributor','originator'=>'Originator','pointOfContact'=>'Point Of Contact','principalInvestigator'=>'Principal Investigator','processor'=>'Processor','publisher'=>'Publisher','author'=>'Author');
$r='';
$i=0;
foreach($this->authors as $k=>$author) :
if ($author->role!=$r)
{
$r=$author->role;
$i=0;
if ($k>0) echo '</li>';
echo '<li>'.$party_zh[$author->role].'';
}
if ($i>0) echo '';
$i+=1;
if (!empty($author->email) && $r!='principalInvestigator')
echo '<a href="mailto:'.$author->email.'">';
echo '<strong title="'.$author->organisation.'">';
if (!empty($author->individual))
echo $author->individual;
else
echo $author->organisation;
echo '</strong>';
if (!empty($author->email)) echo '</a>';
if ($k+1==count($this->authors)) echo '</li>';
endforeach;
?>
</ul>
<hr />
<ul class="unstyled">
<li>Last update: <?php print date('Y-m-d',strtotime($md->ts_created)); ?></li>
<li><strong>Download Metadata:</strong>
<a href="/service/pdf/uuid/<?php echo $md->uuid; ?>"><img src="/images/pdf_icon.gif" alt="Adobe PDF" title="Adobe PDF"></a>
<a href="/service/odt/uuid/<?php echo $md->uuid; ?>"><img src="/images/odt_icon.gif" alt="OpenOffice odt" title="OpenOffice odt"></a>
<a href="/service/doc/uuid/<?php echo $md->uuid; ?>"><img src="/images/doc_icon.gif" alt="Word doc" title="Word doc"></a>
<a href="/service/xml/uuid/<?php echo $md->uuid;?>"><img src="/images/xml_icon.gif" alt="XML" title="XML"></a>
</li>
<!--<li><a href="/data/detail/id/<?php echo $md->id;?>">详细元数据</a></li>-->
<?php if($this->version->c>0):?>
<li id="dataversion">Version: <a href="javascript:void(0);" onclick="dataVersion('<?php echo $md->uuid;?>')" title=""><?= $this->version->c ?><img src="/images/list_extensions.gif" style="vertical-align:middle" /></a></li>
<?php endif;?>
</ul>
</div>
<hr />
</div>
</div>
<script src="/js/metadata-view.js"></script>
<script type="text/javascript" charset="utf-8">
$(function() {
$(".colorbox").colorbox({photo:"true"});
$('.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;?>');});
$('#related_t').click(function(){related(1);});
$('#recommend_t').click(function(){recommend(0);});
$('#literature_t').click(function(){scholarSearch('<?php echo $ev;?>');$('.literatures').parent('li').addClass('active')});
$('.literatures').click(function(){literature(1);});
ajaxpage(0);
related(1);
$('.lit-nav-btn').each(function(index, element) {
$(this).click(function(){
$('.lit-nav').children('li').each(function(index, element) {
$(this).removeClass('active');
});
$(this).parent('li').addClass('active');
});
});
$('#gsearch_t').click(function(){
if($('#searchlist').children('li').length<1)
{
googleSearch('<?php echo $ev;?>');
}
});
$('#show-list').click(function(e) {
method.filelist.get($(this).attr('rel'));
});
});
//ajax literature
function literature(page){
literature_get(page,'<?= $md->uuid; ?>');
}
//ajax related
function related(page){
related_get(page,'<?= $md->uuid; ?>');
}
//ajax recommend
function recommend(page){
recommend_get(page,'<?= $md->uuid; ?>');
}
function getFileList(){
getFileList_h('<?php echo $md->uuid;?>');
}
function ajaxpage(page){
ajaxpage_get(page,'<?= $md->uuid; ?>');
}
<?php if ($this->downhistory) : ?>
$('#recommend_t').parent('li').addClass('active');
$('#recommend').addClass('active');
recommend(0);
<?php else : ?>
$('#related_t').parent('li').addClass('active');
$('#related').addClass('active');
<? endif; ?>
var config = { projection: "EPSG:4326"}
var map=new TMap("watermap",config);
var lat=<?= ($md->south+$md->north)/2; ?>;
var lng=<?= ($md->east+$md->west)/2; ?>;
map.centerAndZoom(new TLngLat(lng,lat),12);
map.setMapType(TMAP_HYBRID_MAP);
<?php if ($md->north==$md->south && $md->east==$md->west) :?>
var marker=new TMarker(new TLngLat(lng,lat));
map.addOverLay(marker);
<?php else :?>
var p1=new TLngLat(<?= $md->west ?>,<?= $md->south ?>);
var p2=new TLngLat(<?= $md->west ?>,<?= $md->north ?>);
var p3=new TLngLat(<?= $md->east ?>,<?= $md->north ?>);
var p4=new TLngLat(<?= $md->east ?>,<?= $md->south ?>);
map.setViewport(new Array(p1,p2,p3,p4));
var bounds = new TBounds(<?= $md->west; ?>,<?= $md->south; ?>,<?= $md->east; ?>,<?= $md->north; ?>);
var config = {
strokeColor:"blue", //折线颜色
fillColor:"#FFFFFF", //填充颜色。当参数为空时,折线覆盖物将没有填充效果
strokeWeight:"3px", //折线的宽度,以像素为单位
opacity:0.3, //折线的透明度取值范围0 - 1
strokeStyle:"dashed" //折线的样式solid或dashed
};
var rect = new TRect(bounds,config);
map.addOverLay(rect);
//map.zoomOut();
<?php endif; ?>
var config = {
type:"TMAP_NAVIGATION_CONTROL_SMALL", //缩放平移的显示类型
anchor:"TMAP_ANCHOR_TOP_LEFT", //缩放平移控件显示的位置
offset:[0,0], //缩放平移控件的偏移值 showZoomInfo:true //是否显示级别提示信息true表示显示false表示隐藏。
};
//创建缩放平移控件对象
control=new TNavigationControl(config);
//添加缩放平移控件
map.addControl(control);
</script>
<?php else: ?>
<p>Cannot find the metadata.</p>
<?php endif;?>
<?php if(!empty($this->dataService)) { ?>
<?php if($this->dataService['service_type'] == 2) { ?>
<?php $this->theme->AppendPlus($this,'datepicker'); ?>
<script src="/js/lib/custom/models/dataservice.js"></script>
<?php }else if($this->dataService['service_type'] == 3) {?>
<?php $this->theme->AppendPlus($this,'datepicker'); ?>
<!-- <script src="/js/lib/custom/models/dataservice.geodata.js"></script> -->
<?php } ?>
<?php } ?>