westdc-zf1/application/default/views/scripts/water/search.phtml

55 lines
2.1 KiB
PHTML
Executable File

<?php
$this->headTitle($this->config->title->site);
$this->headTitle($this->config->title->data);
$this->headTitle('快速搜索');
if (!empty($this->codename)) $this->headTitle($this->codename);
$this->headTitle()->setSeparator(' - ');
$this->headLink()->appendStylesheet('/css/water.css');
$this->breadcrumb('<a href="/">首页</a>');
$this->breadcrumb('<a href="/data">'.$this->config->title->data.'</a>');
$this->breadcrumb('<a href="/water/">黑河综合遥感联合试验</a>');
$this->breadcrumb('快速搜索');
$this->breadcrumb()->setSeparator(' > ');
?>
<div class="tools">
<ul><form id="search" enctype="application/x-www-form-urlencoded" action="/water/search" method="post">
<li><input type="text" name="q" id="q" value="输入关键词搜索标题和摘要" onfocus="myfocus(this);" onblur="myblur(this);"></li>
<li><button type="submit" name="submit" id="submit">搜索</button></li>
<li><button type="button" onclick="location.href='/water/tag'">关键词导航</button></li>
<li><button type="button" onclick="location.href='/water/timeline'">时间轴导航</button></li>
<li><button type="button" onclick="location.href='/water/timemap'">时空联合导航</button></li>
</form></ul>
<script>
function myfocus(element) {
if (element.value == element.defaultValue) {
element.value = '';
}
}
function myblur(element) {
if (element.value == '') {
element.value = element.defaultValue;
}
}
</script>
</div>
<?php if (!empty($this->metadata)) : ?>
<?php echo $this->page->getNavigation();
foreach($this->metadata as $md) : ?>
<div class="mditem">
<hr />
<div class="thumb"><img src="/service/thumb/id/<?php echo $md['id'];?>" /></div>
<h2><a href="/water/<?php echo $md['uuid'];?>"><?php echo $this->escape($md['title']);?></a>
</h2>
<span><?php echo mb_strlen($md['description'])>400?$this->escape(mb_substr($md['description'],0,400,'UTF-8').'...'):$this->escape($md['description']);?></span>
</div>
<?php endforeach; ?>
<hr class="mditem" />
<?php echo $this->page->getNavigation();
else :
?>
<div class="mditem">
<hr />
您的搜索结果为空,请尝试缩小关键词进行查询。
</div>
<?php endif; ?>