更换数据展示样式为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,11 +3,15 @@
$this->headTitle($this->config->title->data); $this->headTitle($this->config->title->data);
$this->headTitle('数据查看'); $this->headTitle('数据查看');
$this->headTitle()->setSeparator(' - '); $this->headTitle()->setSeparator(' - ');
$this->headLink()->appendStylesheet('/css/mdview.css'); $this->headLink()->appendStylesheet('/css/watermdview.css');
$this->breadcrumb('<a href="/">首页</a>'); $this->breadcrumb('<a href="/">首页</a>');
$this->breadcrumb('<a href="/data">'.$this->config->title->data.'</a>'); $this->breadcrumb('<a href="/data">'.$this->config->title->data.'</a>');
$this->breadcrumb('查看元数据'); $this->breadcrumb('查看元数据');
$this->breadcrumb()->setSeparator(' > '); $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/prototype.js');
$this->headScript()->appendFile('/js/OpenLayers.js'); $this->headScript()->appendFile('/js/OpenLayers.js');
$this->headScript()->appendFile('/js/window.js'); $this->headScript()->appendFile('/js/window.js');
@ -17,9 +21,7 @@
<h1><?php echo $this->escape($md->title); <h1><?php echo $this->escape($md->title);
if ($md->title_en) echo '<br />'.$this->escape($md->title_en);?> if ($md->title_en) echo '<br />'.$this->escape($md->title_en);?>
</h1> </h1>
<table width=100%><tr><td> <div id="right">
<div id="ImageViewer"><img src="/data/thumb/id/<?php echo $md->id;?>" /> </div>
</td><td valign="top" align="middle">
<div id="ItemSummary"> <div id="ItemSummary">
<div id="category"> <div id="category">
<ul><?php foreach($this->category as $cat): ?> <ul><?php foreach($this->category as $cat): ?>
@ -44,6 +46,7 @@ endforeach;
echo '</ul></div>'; echo '</ul></div>';
?> ?>
<!--
<?php if ($this->series): ?> <?php if ($this->series): ?>
<div id="series"> <div id="series">
<ul><?php foreach($this->series as $serie): ?> <ul><?php foreach($this->series as $serie): ?>
@ -52,14 +55,17 @@ echo '</ul></div>';
</ul> </ul>
</div> </div>
<?php endif; ?> <?php endif; ?>
-->
<ul id=OtherInfo> <ul id=OtherInfo>
<li id="filesize">数据大小:<?php echo $md->filesize; ?>MB</li> <?php if ($md->fileformat) : ?>
<li id="fileformat">数据格式:<?php echo $md->fileformat; ?></li> <li id="fileformat">格式:<?php echo $md->fileformat; ?></li>
<?php endif; ?>
<li id="filesize">大小:<?php echo $md->filesize; ?>MB</li>
<?php if ($this->downloaded>9) :?> <?php if ($this->downloaded>9) :?>
<li id="downtimes">下载:<?php echo $this->downloaded; ?></li> <li id="downtimes">下载:<?php echo $this->downloaded; ?></li>
<?php endif; ?> <?php endif; ?>
<li id="viewtimes">浏览量:<?php echo $this->viewed; ?></li> <li id="viewtimes">浏览量:<?php echo $this->viewed; ?></li>
<!--
<?php if ($md->projection) : ?> <?php if ($md->projection) : ?>
<li id="projection" title="<?= $this->projection; ?>">数据投影: <li id="projection" title="<?= $this->projection; ?>">数据投影:
<?php <?php
@ -74,6 +80,7 @@ else
} }
?></li> ?></li>
<?php endif; ?> <?php endif; ?>
-->
<?php if (!empty($md->timebegin)) : ?> <?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> <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 endif; ?>
@ -86,7 +93,7 @@ else
echo $this->doc; echo $this->doc;
}?>">数据说明文档</a></li> }?>">数据说明文档</a></li>
<?php endif; ?> <?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> </ul>
<div id="linkurl"> <div id="linkurl">
<?php if (!$md->datatype) : ?> <?php if (!$md->datatype) : ?>
@ -96,12 +103,15 @@ else
</div> </div>
</div> </div>
</td><td valign="top"> <hr />
<h2>空间位置</h2>
<div id='watermap'></div>
<hr />
<h2>联系信息</h2>
<div id="authors"> <div id="authors">
<h2>联系人</h2>
<ul> <ul>
<?php <?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=''; $r='';
$i=0; $i=0;
foreach($this->authors as $k=>$author) : foreach($this->authors as $k=>$author) :
@ -114,39 +124,37 @@ if ($author['role']!=$r)
} }
if ($i>0) echo ''; if ($i>0) echo '';
$i+=1; $i+=1;
if (!empty($author['email']) && $r!='principalInvestigator')
echo '<a href="mailto:'.$author['email'].'">';
echo '<strong title="'.$author['organisation'].'">'; echo '<strong title="'.$author['organisation'].'">';
if (!empty($author['individual'])) if (!empty($author['individual']))
echo $author['individual']; echo $author['individual'];
else else
echo $author['organisation']; echo $author['organisation'];
echo '</strong>'; echo '</strong>';
if (!empty($author['email'])) echo '</a>';
if ($k+1==count($this->authors)) echo '</li>'; if ($k+1==count($this->authors)) echo '</li>';
endforeach; endforeach;
?> ?>
</ul> </ul>
<h2>其他信息</h2><ul> <hr />
<li>元数据更新时间:<?php print date('Y-m-d',strtotime($md->ts_created)); ?></li> <ul>
<li><a href="/data/detail/id/<?php echo $md->id;?>">详细元数据</a></li> <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/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>-->
<li><a href="#" id="show-list" rel="<?php echo $md->uuid;?>">文件列表</a></li>
</ul> </ul>
</div> </div>
</td></tr></table>
<script type="text/javascript"> </div>
(function(a, b) { <div id="left">
var ah=document.getElementById(a).offsetHeight, bh=document.getElementById(b).offsetHeight; <div id="ImageViewer"><img src="/data/thumb/id/<?php echo $md->id;?>" /> </div>
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 id="abstract"> <div id="abstract">
<p> <p>
<?php echo str_replace(array("\r\n", "\n", "\r"),'</p><p>',$md->description);?> <?php echo str_replace(array("\r\n", "\n", "\r"),'</p><p>',$md->description);?>
</p> </p>
</div> </div>
<hr /> <hr />
<div id="cite"> <div id="cite">
<?php if ($md->citation) : ?> <?php if ($md->citation) : ?>
<h2>本数据引用方式</h2> <h2>本数据引用方式</h2>
@ -156,7 +164,10 @@ endforeach;
<h2>建议参考文献</h2> <h2>建议参考文献</h2>
<ol> <ol>
<?php foreach($this->ref as $ref) : <?php foreach($this->ref as $ref) :
if (empty($ref['link']))
echo '<li>'.$ref['reference'].'</li>'; echo '<li>'.$ref['reference'].'</li>';
else
echo '<li>'.$ref['reference'].' <a href="'.$ref['link'].'">下载</a></li>';
endforeach; endforeach;
?> ?>
</ol> </ol>
@ -237,8 +248,7 @@ echo '</li>';
</div> </div>
<?php endif; ?> <?php endif; ?>
<hr /> <hr />
<div id="comments">
<div id="comment">
<h2>数据评论</h2> <h2>数据评论</h2>
<div id="allcomments"> <div id="allcomments">
</div> </div>
@ -267,6 +277,8 @@ function reportError(request)
}); });
</script> </script>
<?php echo $this->commentForm; ?> <?php echo $this->commentForm; ?>
</div>
</div> </div>
<div id="window-outter" style="display:none;"> <div id="window-outter" style="display:none;">
<div id="window-inner"> <div id="window-inner">
@ -278,21 +290,23 @@ function reportError(request)
</div> </div>
</div> </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> <script type="text/javascript" charset="utf-8">
<!--test.westgis.ac.cn var map = new GMap2(document.getElementById("watermap"));
<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"));
var plotbounds=new GLatLngBounds(new GLatLng(<?= $md->south; ?>,<?= $md->west; ?>),new GLatLng(<?= $md->north; ?>,<?= $md->east; ?>)); var plotbounds=new GLatLngBounds(new GLatLng(<?= $md->south; ?>,<?= $md->west; ?>),new GLatLng(<?= $md->north; ?>,<?= $md->east; ?>));
var zoomlevel=map.getBoundsZoomLevel(plotbounds); var zoomlevel=map.getBoundsZoomLevel(plotbounds);
zoomlevel--; zoomlevel--;
<?php if ($md->north==$md->south) : ?>
zoomlevel=10;
<?php endif; ?>
if (zoomlevel>16) zoomlevel=16; if (zoomlevel>16) zoomlevel=16;
map.setCenter(new GLatLng(<?= ($md->south+$md->north)/2; ?>,<?= ($md->east+$md->west)/2; ?>), zoomlevel); 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(); 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([ var polygon=new GPolygon([
new GLatLng(<?= $md->north; ?>,<?= $md->west; ?>), new GLatLng(<?= $md->north; ?>,<?= $md->west; ?>),
new GLatLng(<?= $md->north; ?>,<?= $md->east; ?>), new GLatLng(<?= $md->north; ?>,<?= $md->east; ?>),
@ -301,52 +315,8 @@ function reportError(request)
new GLatLng(<?= $md->north; ?>,<?= $md->west; ?>) new GLatLng(<?= $md->north; ?>,<?= $md->west; ?>)
],"#f33f00",5,1,"#ff0000",0.2); ],"#f33f00",5,1,"#ff0000",0.2);
map.addOverlay(polygon); map.addOverlay(polygon);
<?php endif; ?>
</script> </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: ?> <?php else: ?>
<p>Cannot find the metadata.</p> <p>Cannot find the metadata.</p>
<p>没有找到对应的元数据。</p> <p>没有找到对应的元数据。</p>