westdc-zf1/module/Metadata/view/metadata/index/view.phtml

160 lines
5.7 KiB
PHTML

<?php
$md = $this->data ;
$this->headTitle($md['title']);
$theme = new \Sookon\Helpers\Theme;
$theme->AppendPlus($this,'google_map_v3');
?>
<div class="row">
<div class="span8">
<h3 class="box-title"><?= $this->data['title'] ?></h3>
<div class="row">
<div class="span8">
<h4>摘要信息</h4>
<div>
<p class="lead" >
<img src="/service/thumb/id/<?php echo $md['id'];?>" class="pull-left img-polaroid" style="margin-right:20px"/>
<?= $this->data['description'] ?>
</p>
</div>
<hr />
</div>
</div>
<div class="row">
<div class="span8">
<h4>标签</h4>
<?php
$kw=array('discipline'=>'学科','place'=>'地点','theme'=>'主题','temporal'=>'时间词','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; ?>"><?php echo $kw[$kt].":"; ?></a></li>
<?php
}
echo '<li><a href="/data/tag/'.urlencode($cg['keyword']).'"><i class="icon-tags"></i>&nbsp;&nbsp;'.$cg['keyword'].'</a></li>';
endforeach;
?>
</ul>
</div><!--span8-->
</div>
</div><!-- span8 left panle-->
<div class="span4">
<h4>空间位置</h4>
<div id='watermap' style="width:100%;height:300px;"></div>
<hr />
<h4>数据细节</h4>
<ul class="inline unstyled well">
<?php if ($md['fileformat']) : ?>
<li><strong>格式:</strong><?php echo $md['fileformat']; ?></li>
<?php endif; ?>
<li><strong>大小:</strong><?php echo $md['filesize']; ?>MB</li>
<?php if ($this->downloaded>9) :?>
<li><strong>下载:</strong><?php echo $this->downloaded; ?></li>
<?php endif; ?>
<li><strong>浏览:</strong><?php echo $md['viewedcount']; ?></li>
<?php if (!empty($md['timebegin'])) : ?>
<li id="datatimes">
<strong>数据时间范围:</strong>
<?php echo date('Y-m-d',strtotime($md['timebegin']));if (!empty($md['timeend'])) echo " 至 ".date('Y-m-d',strtotime($md['timeend'])); ?>
</li>
<?php endif; ?>
<li id="datatype"><strong>数据共享方式:</strong><?php if ($md['datatype']) print "离线"; else print "在线(可直接下载)";?> </li>
</ul>
<!-- data detail -->
<hr />
<a href="<?= isset($md['url']) ? $md['url']:'javascript:alert(\'暂无链接信息\');' ?>" class="btn btn-primary btn-large btn-block" title="前去下载" target="_blank">
访问数据详细页面
</a>
<!-- url jump button -->
</div> <!-- span4 right panle-->
</div><!--/span12-->
</div><!-- /row -->
<script>
<!--
$(function() {
google.maps.event.addDomListener(window, 'load', initialize);
});
var map = null;
var mapElementID = "watermap";
var bounds = null;
var rectangle = null;
var zoomlevel = 1;
var bound = {
lat:<?= ($md['south']+$md['north'])/2; ?>,
lng:<?= ($md['east']+$md['west'])/2; ?>,
zoom:<?php if ($md['north']==$md['south']) { ?> 10 <?php }else {?> 6 <?php }?>,
east:<?= $md['east']; ?>,
west:<?= $md['west']; ?>,
south:<?= $md['south']; ?>,
north:<?= $md['north']; ?>
}
//map
//加载地图
function initialize() {
var myLatlng = new google.maps.LatLng(bound.lat,bound.lng);
zoomlevel = bound.zoom;
var myOptions = {
zoom: zoomlevel,
center: myLatlng,
mapTypeId: google.maps.MapTypeId.HYBRID
}
map = new google.maps.Map(document.getElementById(mapElementID), myOptions);
setRectangle(bound.east,bound.west,bound.south,bound.north);
}
function setRectangle(east,west,south,north){
if(east.toFixed(1) != west.toFixed(1) && south.toFixed(1)!= north.toFixed(1) ){
bounds = new google.maps.LatLngBounds(
new google.maps.LatLng(south,west),
new google.maps.LatLng(north,east)
);
rectangle = new google.maps.Rectangle({
bounds: bounds,
editable: false
});
rectangle.setMap(map);
}else{
var position = new google.maps.LatLng(south,east);
var marker = new google.maps.Marker({
position: position,
map: map,
});
}
var bounds = new google.maps.LatLngBounds();
bounds.extend(new google.maps.LatLng(south,west));
bounds.extend(new google.maps.LatLng(north,east));
map.fitBounds(bounds);
}
-->
</script>