修改了分页类中提供的样式

This commit is contained in:
Li Jianxuan 2013-04-10 03:02:48 +00:00
parent ac2fc22970
commit 505d5a9776
3 changed files with 334 additions and 333 deletions

View File

@ -1,7 +1,6 @@
<?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(' - ');
@ -13,7 +12,7 @@ $this->breadcrumb('高级搜索');
$this->breadcrumb()->setSeparator(' > ');
$this->headScript()->appendFile('http://maps.google.cn/maps?file=api&v=2&key='.$this->config->google->maps->api);
?>
<div id='tools'>
<div>
<?= $this->partial('data/tools.phtml'); ?>
</div>
<?php if (!empty($this->metadata)) :

View File

@ -57,50 +57,52 @@ class Pagination
public function getNavigation()
{
if ($this->_itemCount<$this->_pageSize) return '';
$navigation = '<div class="PageNavigation">';
$navigation .= "共有".$this->_typestr."<em>$this->_itemCount</em>条 \n";
$navigation = '<div class="pagination" style="line-height:14px">';
$navigation .= "<ul>";
$navigation .= "<li><span>共有".$this->_typestr."<em>$this->_itemCount</em>条</span></li> \n";
$pageCote = ceil($this->_currentPage / ($this->_navigationItemCount - 1)) - 1; //当前页处于第几栏分页
$pageCoteCount = ceil($this->_pageCount / ($this->_navigationItemCount - 1)); //总分页栏
$pageStart = $pageCote * ($this->_navigationItemCount -1) + 1; //分页栏中起始页
$pageEnd = $pageStart + $this->_navigationItemCount - 1; //分页栏中终止页
if($this->_pageCount < $pageEnd)
{
$pageEnd = $this->_pageCount;
}
if($pageCote > 0) //首页导航
{
$navigation .= '<a href="'.$this->createHref(1)."\">$this->_firstPageString</a> ";
$navigation .= '<li><a href="'.$this->createHref(1)."\">$this->_firstPageString</a></li> ";
}
if($this->_currentPage != 1) //上一页导航
{
$navigation .= '<a href="'.$this->createHref($this->_currentPage-1);
$navigation .= "\">$this->_previousPageString</a> ";
$navigation .= '<li><a href="'.$this->createHref($this->_currentPage-1);
$navigation .= "\">$this->_previousPageString</a></li> ";
}
while ($pageStart <= $pageEnd) //构造数字导航区
{
if($pageStart == $this->_currentPage)
{
$navigation .= "<strong>$pageStart</strong> ";
$navigation .= '<li class="active"><a href="javascript:;">'.$pageStart.'</a></li> ';
}
else
{
$navigation .= '<a href="'.$this->createHref($pageStart)."\">$pageStart</a> ";
$navigation .= '<li><a href="'.$this->createHref($pageStart)."\">$pageStart</a></li> ";
}
$pageStart++;
}
if($this->_currentPage != $this->_pageCount) //下一页导航
{
$navigation .= '<a href="'.$this->createHref($this->_currentPage+1)."\">$this->_nextPageString</a> ";
$navigation .= '<li><a href="'.$this->createHref($this->_currentPage+1)."\">$this->_nextPageString</a></li> ";
}
if($pageCote < $pageCoteCount-1) //未页导航
{
$navigation .= '<a href="'.$this->createHref($this->_pageCount)."\">$this->_lastPageString</a> ";
$navigation .= '<li><a href="'.$this->createHref($this->_pageCount)."\">$this->_lastPageString</a></li> ";
}
//添加直接导航框
$navigation .= '<input type="text" size="3" onkeydown="if(event.keyCode==13){window.location=\' ';
$navigation .= '<input type="text" size="3" class="input-mini" onkeydown="if(event.keyCode==13){window.location=\' ';
$navigation .= $this->createHref().'\'+this.value;return false;}" />';
$navigation .= "</div>";
$navigation .= "</ul></div>";
return $navigation;
}