From 0d8a6a24d4caef63244a7cd0ec2acf3827b72c77 Mon Sep 17 00:00:00 2001 From: rurban Date: Thu, 12 Nov 2009 08:47:58 +0000 Subject: [PATCH] reenable HTML caption: quoting git-svn-id: svn://svn.code.sf.net/p/phpwiki/code/trunk@7267 96ab9672-09ca-45d6-a79d-3d69d39ca109 --- lib/PageList.php | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/lib/PageList.php b/lib/PageList.php index a5534bdea..b6acb163c 100644 --- a/lib/PageList.php +++ b/lib/PageList.php @@ -427,10 +427,8 @@ class _PageList_Column_content extends _PageList_Column { $html[] = HTML::p(HTML::small(array('class' => 'search-context'), $line)); } if ($score) - $html[] = sprintf("... [%0.1f]",$score); - return HTML::div(array('style' => 'font-size:x-small'), - HTML::div(array('class' => 'transclusion'), - $html)); + $html[] = HTML::small(sprintf("... [%0.1f]", $score)); + return $html; } // Remove special characters so that highlighting works $search = preg_replace('/^[\^\*]/', '', $search); @@ -731,12 +729,18 @@ class PageList { return array('sortby','limit','paging','count','dosort'); } - function setCaption ($caption_string) { - $this->_caption = $caption_string; + /** + * @param caption string or HTML + */ + function setCaption ($caption) { + $this->_caption = $caption; } - function addCaption ($caption_string) { - $this->_caption = HTML($this->_caption," ",$caption_string); + /** + * @param caption string or HTML + */ + function addCaption ($caption) { + $this->_caption = HTML($this->_caption," ",$caption); } function getCaption () { @@ -1488,7 +1492,8 @@ class PageList { 'class' => 'pagelist', )); if ($caption) { - $caption = preg_replace('/{total}/', $nb_row, asString($caption)); + if (is_string($caption)) + $caption = preg_replace('/{total}/', $nb_row, asString($caption)); $table->pushContent(HTML::caption(array('align'=>'top'), $caption)); } @@ -1571,7 +1576,8 @@ class PageList { } $out = HTML(); if ($caption) { - $caption = preg_replace('/{total}/', $nb_row, asString($caption)); + if (is_string($caption)) + $caption = preg_replace('/{total}/', $nb_row, asString($caption)); $out->pushContent(HTML::p($caption)); } // Semantic Search et al: only unique list entries, esp. with nopage @@ -1748,6 +1754,7 @@ class PageList { function _emptyList($caption) { $html = HTML(); if ($caption) { + if (is_string($caption)) $caption = preg_replace('/{total}/', '0', asString($caption)); $html->pushContent(HTML::p($caption)); } -- 2.45.0