From: <var...@us...> - 2021-07-27 11:03:05
|
Revision: 10366 http://sourceforge.net/p/phpwiki/code/10366 Author: vargenau Date: 2021-07-27 11:03:03 +0000 (Tue, 27 Jul 2021) Log Message: ----------- Add missing global $request Modified Paths: -------------- trunk/lib/PageList.php Modified: trunk/lib/PageList.php =================================================================== --- trunk/lib/PageList.php 2021-07-27 10:42:42 UTC (rev 10365) +++ trunk/lib/PageList.php 2021-07-27 11:03:03 UTC (rev 10366) @@ -1379,6 +1379,8 @@ */ public function _addColumn($column) { + global $request; + if (isset($this->_columns_seen[$column])) return false; // Already have this one. if (!isset($this->_types[$column])) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2021-07-27 19:44:40
|
Revision: 10372 http://sourceforge.net/p/phpwiki/code/10372 Author: vargenau Date: 2021-07-27 19:44:39 +0000 (Tue, 27 Jul 2021) Log Message: ----------- function pageCompare: do not pass arguments by reference Modified Paths: -------------- trunk/lib/PageList.php Modified: trunk/lib/PageList.php =================================================================== --- trunk/lib/PageList.php 2021-07-27 15:40:26 UTC (rev 10371) +++ trunk/lib/PageList.php 2021-07-27 19:44:39 UTC (rev 10372) @@ -1439,7 +1439,7 @@ /** * Compare _PageList_Page objects. **/ - private function pageCompare(&$a, &$b) + private function pageCompare($a, $b) { if (empty($this->_sortby) or count($this->_sortby) == 0) { // No columns to sort by This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2021-07-30 14:09:07
|
Revision: 10406 http://sourceforge.net/p/phpwiki/code/10406 Author: vargenau Date: 2021-07-30 14:09:05 +0000 (Fri, 30 Jul 2021) Log Message: ----------- lib/PageList.php: make <<AllPages info=content>> work Modified Paths: -------------- trunk/lib/PageList.php Modified: trunk/lib/PageList.php =================================================================== --- trunk/lib/PageList.php 2021-07-30 13:12:14 UTC (rev 10405) +++ trunk/lib/PageList.php 2021-07-30 14:09:05 UTC (rev 10406) @@ -407,11 +407,12 @@ ) { $revision_handle = $page_handle->getCurrentRevision(true); } + if (!empty($revision_handle->_data['%pagedata'])) { + $revision_handle->_data['%pagedata']['_cached_html'] = ''; + } + $c =&$revision_handle->getPackedContent(); if ($this->_field == 'hi_content') { - if (!empty($revision_handle->_data['%pagedata'])) { - $revision_handle->_data['%pagedata']['_cached_html'] = ''; - } $search = $this->search; $score = ''; if (is_object($page_handle) and !empty($page_handle->score)) @@ -435,7 +436,6 @@ // Remove special characters so that highlighting works $search = preg_replace('/^[\^\*]/', '', $search); $search = preg_replace('/[\^\*]$/', '', $search); - $c =& $revision_handle->getPackedContent(); if ($search and ($i = strpos(strtolower($c), strtolower($search))) !== false) { $l = strlen($search); $j = max(0, $i - ($this->bytes / 2)); @@ -453,8 +453,11 @@ return HTML::div(array('class' => 'align-center'), $c . " " . ($score ? sprintf("[%0.1f]", $score) : "")); } - } elseif (($len = strlen($c)) > $this->bytes) { - $c = substr($c, 0, $this->bytes); + } else { + $len = strlen($c); + if ($len > $this->bytes) { + $c = substr($c, 0, $this->bytes); + } } include_once 'lib/BlockParser.php'; // false --> don't bother processing hrefs for embedded WikiLinks This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2021-09-17 11:07:13
|
Revision: 10561 http://sourceforge.net/p/phpwiki/code/10561 Author: vargenau Date: 2021-09-17 11:07:11 +0000 (Fri, 17 Sep 2021) Log Message: ----------- Avoid PHP warning Modified Paths: -------------- trunk/lib/PageList.php Modified: trunk/lib/PageList.php =================================================================== --- trunk/lib/PageList.php 2021-09-17 10:48:53 UTC (rev 10560) +++ trunk/lib/PageList.php 2021-09-17 11:07:11 UTC (rev 10561) @@ -410,7 +410,7 @@ if (!empty($revision_handle->_data['%pagedata'])) { $revision_handle->_data['%pagedata']['_cached_html'] = ''; } - $c =&$revision_handle->getPackedContent(); + $c = $revision_handle->getPackedContent(); if ($this->_field == 'hi_content') { $search = $this->search; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2021-11-17 18:12:40
|
Revision: 10655 http://sourceforge.net/p/phpwiki/code/10655 Author: vargenau Date: 2021-11-17 18:12:35 +0000 (Wed, 17 Nov 2021) Log Message: ----------- explicitly cast to int to avoid warning Modified Paths: -------------- trunk/lib/PageList.php Modified: trunk/lib/PageList.php =================================================================== --- trunk/lib/PageList.php 2021-11-17 17:28:49 UTC (rev 10654) +++ trunk/lib/PageList.php 2021-11-17 18:12:35 UTC (rev 10655) @@ -1808,7 +1808,7 @@ foreach (array_reverse($rows) as $one_row) { $pagehtml = $one_row['render']; if (!$pagehtml) continue; - $group = ($i++ / $this->_group_rows); + $group = (int)($i++ / $this->_group_rows); //TODO: here we switch every row, in tables every third. // unification or parametrized? $class = ($group % 2) ? 'oddrow' : 'evenrow'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2022-02-03 15:35:14
|
Revision: 10973 http://sourceforge.net/p/phpwiki/code/10973 Author: vargenau Date: 2022-02-03 15:35:12 +0000 (Thu, 03 Feb 2022) Log Message: ----------- Indent Modified Paths: -------------- trunk/lib/PageList.php Modified: trunk/lib/PageList.php =================================================================== --- trunk/lib/PageList.php 2022-02-02 18:07:25 UTC (rev 10972) +++ trunk/lib/PageList.php 2022-02-03 15:35:12 UTC (rev 10973) @@ -115,8 +115,7 @@ $src = false; $noimg_src = $WikiTheme->getButtonURL('sort_none'); if ($noimg_src) - $noimg = HTML::img(array('src' => $noimg_src, - 'alt' => '.')); + $noimg = HTML::img(array('src' => $noimg_src, 'alt' => '.')); else $noimg = HTML::raw(''); $reverse = false; @@ -224,7 +223,8 @@ if ($this->_field == 'hits') return (int)$val; elseif (is_object($val) && method_exists($val, 'asString')) - return $val->asString(); else + return $val->asString(); + else return (string)$val; } } @@ -477,7 +477,8 @@ if (is_object($page_handle) and !empty($page_handle->score)) return $page_handle->score; elseif (is_array($page_handle) and !empty($page_handle['score'])) - return $page_handle['score']; else + return $page_handle['score']; + else return substr(parent::_getValue($page_handle, $revision_handle), 0, 50); } } @@ -983,8 +984,10 @@ if (is_a($dbi, 'WikiDB_SQL')) { extract($dbi->_backend->_table_names); $res = $dbi->_backend->_dbh->getOne("SELECT max(length(pagename)) FROM $page_tbl"); - if (DB::isError($res) || empty($res)) return false; - else return $res; + if (DB::isError($res) || empty($res)) + return false; + else + return $res; } else return false; } @@ -1008,10 +1011,11 @@ if ($this->isEmpty()) return $this->_emptyList($caption); elseif (isset($this->_options['listtype']) - and in_array($this->_options['listtype'], array('ol', 'ul', 'comma', 'dl')) - ) - return $this->generateList($caption); elseif (count($this->_columns) == 1) - return $this->generateList($caption); else + and in_array($this->_options['listtype'], array('ol', 'ul', 'comma', 'dl'))) + return $this->generateList($caption); + elseif (count($this->_columns) == 1) + return $this->generateList($caption); + else return $this->_generateTable($caption); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |