更换数据展示样式为water格式

This commit is contained in:
wlx 2011-04-20 08:39:51 +00:00
parent d8904f2948
commit 5aae37ecf5
1 changed files with 55 additions and 85 deletions

View File

@ -3,23 +3,25 @@
$this->headTitle($this->config->title->data);
$this->headTitle('数据查看');
$this->headTitle()->setSeparator(' - ');
$this->headLink()->appendStylesheet('/css/mdview.css');
$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(' > ');
//http://westdc.westgis.ac.cn
$this->headScript()->appendFile('http://maps.google.com/maps?file=api&v=2&key=ABQIAAAACD-MqkkoOm60o_dvwdcKVhRBSKpgcP88GYi6r2Of16IkMX_4YhSBQsywCi4J2_fh4nBuWmK7gyRjLg');
//$this->headScript()->appendFile('http://maps.google.com/maps?file=api&v=2&key=ABQIAAAACD-MqkkoOm60o_dvwdcKVhThiRESR0xRCe9JKd36EL3glTk0OxTsRzifkUWmTTrYWaE7dY1lYUlGxA');
$this->headScript()->appendFile('/js/prototype.js');
$this->headScript()->appendFile('/js/OpenLayers.js');
$this->headScript()->appendFile('/js/window.js');
$this->headScript()->appendFile('/js/window.js');
$this->headLink()->appendStylesheet('/js/theme/default/style.css');
?>
<?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>
<table width=100%><tr><td>
<div id="ImageViewer"><img src="/data/thumb/id/<?php echo $md->id;?>" /> </div>
</td><td valign="top" align="middle">
<div id="right">
<div id="ItemSummary">
<div id="category">
<ul><?php foreach($this->category as $cat): ?>
@ -44,6 +46,7 @@ endforeach;
echo '</ul></div>';
?>
<!--
<?php if ($this->series): ?>
<div id="series">
<ul><?php foreach($this->series as $serie): ?>
@ -52,14 +55,17 @@ echo '</ul></div>';
</ul>
</div>
<?php endif; ?>
-->
<ul id=OtherInfo>
<li id="filesize">数据大小:<?php echo $md->filesize; ?>MB</li>
<li id="fileformat">数据格式:<?php echo $md->fileformat; ?></li>
<?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
@ -74,6 +80,7 @@ else
}
?></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; ?>
@ -86,7 +93,7 @@ else
echo $this->doc;
}?>">数据说明文档</a></li>
<?php endif; ?>
<li id="datatype">数据共享方式:<?php if ($md->datatype) print "离线(可免费申请)"; else print "在线(可直接下载)";?></li>
<li id="datatype">数据共享方式:<?php if ($md->datatype) print "离线"; else print "在线(可直接下载)";?> <a href="#" id="show-list" rel="<?php echo $md->uuid;?>">文件列表</a></li>
</ul>
<div id="linkurl">
<?php if (!$md->datatype) : ?>
@ -96,12 +103,15 @@ else
</div>
</div>
</td><td valign="top">
<hr />
<h2>空间位置</h2>
<div id='watermap'></div>
<hr />
<h2>联系信息</h2>
<div id="authors">
<h2>联系人</h2>
<ul>
<?php
$party_zh=array('resourceProvider'=>'资源提供者','custodian'=>'维护者','owner'=>'拥有者','user'=>'用户','distributor'=>'数据服务联系人','originator'=>'创建者','pointOfContact'=>'联系人','principalInvestigator'=>'调查者','processor'=>'处理者','publisher'=>'元数据发布者','author'=>'元数据作者');
$party_zh=array('resourceProvider'=>'资源提供者','custodian'=>'维护者','owner'=>'拥有者','user'=>'用户','distributor'=>'数据服务联系人','originator'=>'创建者','pointOfContact'=>'联系人','principalInvestigator'=>'数据调查与处理者','processor'=>'处理者','publisher'=>'元数据发布者','author'=>'元数据作者');
$r='';
$i=0;
foreach($this->authors as $k=>$author) :
@ -114,39 +124,37 @@ if ($author['role']!=$r)
}
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>
<h2>其他信息</h2><ul>
<li>元数据更新时间:<?php print date('Y-m-d',strtotime($md->ts_created)); ?></li>
<li><a href="/data/detail/id/<?php echo $md->id;?>">详细元数据</a></li>
<li><a href="/data/xml/uuid/<?php echo $md->uuid;?>"><img src="/images/xml.gif" alt="查看XML源文件"></a></li>
<li><a href="#" id="show-list" rel="<?php echo $md->uuid;?>">文件列表</a></li>
<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></li>
<!--<li><a href="/data/detail/id/<?php echo $md->id;?>">详细元数据</a></li>-->
</ul>
</div>
</td></tr></table>
<script type="text/javascript">
(function(a, b) {
var ah=document.getElementById(a).offsetHeight, bh=document.getElementById(b).offsetHeight;
if (ah > bh) document.getElementById(b).style.height = ah + 'px';
})('ItemSummary', 'ImageViewer');
</script>
<div style="clear:both;border-top:0px solid transparent !important;"></div>
<hr />
<div id='map'></div>
</div>
<div id="left">
<div id="ImageViewer"><img src="/data/thumb/id/<?php echo $md->id;?>" /> </div>
<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>
@ -156,7 +164,10 @@ endforeach;
<h2>建议参考文献</h2>
<ol>
<?php foreach($this->ref as $ref) :
echo '<li>'.$ref['reference'].'</li>';
if (empty($ref['link']))
echo '<li>'.$ref['reference'].'</li>';
else
echo '<li>'.$ref['reference'].' <a href="'.$ref['link'].'">下载</a></li>';
endforeach;
?>
</ol>
@ -237,8 +248,7 @@ echo '</li>';
</div>
<?php endif; ?>
<hr />
<div id="comment">
<div id="comments">
<h2>数据评论</h2>
<div id="allcomments">
</div>
@ -267,6 +277,8 @@ function reportError(request)
});
</script>
<?php echo $this->commentForm; ?>
</div>
</div>
<div id="window-outter" style="display:none;">
<div id="window-inner">
@ -278,21 +290,23 @@ function reportError(request)
</div>
</div>
</div>
<!--westdc.westgis.ac.cn-->
<script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAACD-MqkkoOm60o_dvwdcKVhRBSKpgcP88GYi6r2Of16IkMX_4YhSBQsywCi4J2_fh4nBuWmK7gyRjLg"></script>
<!--test.westgis.ac.cn
<script src='http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAACD-MqkkoOm60o_dvwdcKVhThiRESR0xRCe9JKd36EL3glTk0OxTsRzifkUWmTTrYWaE7dY1lYUlGxA'></script>
-->
<script type="text/javascript">
var map = new GMap2(document.getElementById("map"));
<script type="text/javascript" charset="utf-8">
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--;
<?php if ($md->north==$md->south) : ?>
zoomlevel=10;
<?php endif; ?>
if (zoomlevel>16) zoomlevel=16;
map.setCenter(new GLatLng(<?= ($md->south+$md->north)/2; ?>,<?= ($md->east+$md->west)/2; ?>), zoomlevel);
map.setMapType(G_PHYSICAL_MAP);
map.setMapType(G_SATELLITE_MAP);
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; ?>),
@ -301,52 +315,8 @@ function reportError(request)
new GLatLng(<?= $md->north; ?>,<?= $md->west; ?>)
],"#f33f00",5,1,"#ff0000",0.2);
map.addOverlay(polygon);
<?php endif; ?>
</script>
<!--
<script type="text/javascript">
var map;
map = new OpenLayers.Map('map');
map.addControl(new OpenLayers.Control.LayerSwitcher());
var gphy = new OpenLayers.Layer.Google(
"Google Physical",
{type: G_PHYSICAL_MAP}
);
var gmap = new OpenLayers.Layer.Google(
"Google Streets" // the default
);
var ghyb = new OpenLayers.Layer.Google(
"Google Hybrid",
{type: G_HYBRID_MAP}
);
var gsat = new OpenLayers.Layer.Google(
"Google Satellite",
{type: G_SATELLITE_MAP}
);
var ol_wms = new OpenLayers.Layer.WMS( "OpenLayers WMS",
"http://labs.metacarta.com/wms/vmap0?", {layers: 'basic'} );
map.addLayers([ol_wms,gphy, gmap, ghyb, gsat]);
//map.zoomToExtent(extent);
//map.setCenter(new OpenLayers.LonLat(102, 36), 4);
var ajax=new OpenLayers.Ajax.Request('/metadata/json/id/<?php echo $md->id; ?>',{method:'get',onSuccess:featureresult});
function featureresult(response){
var feature1= eval('(' + response.responseText + ')');
//alert(feature1.type);
var geojson_format = new OpenLayers.Format.GeoJSON();
var vector_layer = new OpenLayers.Layer.Vector('metadata');
map.addLayer(vector_layer);
vector_layer.addFeatures(geojson_format.read(feature1));
map.zoomToExtent(vector_layer.getExtent());
var sf = new OpenLayers.Control.SelectFeature(vector_layer);
map.addControl(sf);
sf.activate();
}
</script>
-->
<?php else: ?>
<p>Cannot find the metadata.</p>
<p>没有找到对应的元数据。</p>