mirror of
https://github.com/typecho/typecho.git
synced 2025-01-18 04:58:20 +01:00
增加分页 HTML 标签选项,问题详情见:http://forum.typecho.org/viewtopic.php?f=7&t=4712
This commit is contained in:
parent
6c09da6bda
commit
a6c4ebb173
@ -1359,7 +1359,7 @@ class Widget_Archive extends Widget_Abstract_Contents
|
||||
* @return void
|
||||
*/
|
||||
public function pageNav($prev = '«', $next = '»', $splitPage = 3, $splitWord = '...',
|
||||
$class = 'page-navigator', $currentClass = 'current')
|
||||
$class = 'page-navigator', $currentClass = 'current', $htmlTag = 'ol')
|
||||
{
|
||||
if ($this->have()) {
|
||||
$hasNav = false;
|
||||
@ -1376,9 +1376,11 @@ class Widget_Archive extends Widget_Abstract_Contents
|
||||
$nav = new Typecho_Widget_Helper_PageNavigator_Box($this->_total,
|
||||
$this->_currentPage, $this->parameter->pageSize, $query);
|
||||
|
||||
echo '<ol class="' . $class . '">';
|
||||
/** 添加判断防止输入错误的标签,判断逻辑:如果为 <ul>,使用 <ul>;否则,使用 <ol> */
|
||||
$htmlTag = ($htmlTag == 'ul') ? 'ul' : 'ol';
|
||||
echo '<' . $htmlTag . ' class="' . $class . '">';
|
||||
$nav->render($prev, $next, $splitPage, $splitWord, $currentClass);
|
||||
echo '</ol>';
|
||||
echo '</' . $htmlTag . '>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user