From: <var...@us...> - 2010-08-23 15:14:01
|
Revision: 7648 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7648&view=rev Author: vargenau Date: 2010-08-23 15:13:51 +0000 (Mon, 23 Aug 2010) Log Message: ----------- Avoid information duplication Modified Paths: -------------- trunk/lib/PageList.php Modified: trunk/lib/PageList.php =================================================================== --- trunk/lib/PageList.php 2010-08-23 15:10:10 UTC (rev 7647) +++ trunk/lib/PageList.php 2010-08-23 15:13:51 UTC (rev 7648) @@ -22,43 +22,9 @@ /** * List a number of pagenames, optionally as table with various columns. - * This library relieves some work for these plugins: * - * AllPages, BackLinks, LikePages, MostPopular, TitleSearch, WikiAdmin* and more + * See pgsrc/Help%2FPageList for arguments and details * - * It also allows dynamic expansion of those plugins to include more - * columns in their output. - * - * Column 'info=' arguments: - * - * 'pagename' _("Page Name") - * 'mtime' _("Last Modified") - * 'hits' _("Hits") - * 'summary' _("Last Summary") - * 'version' _("Version")), - * 'author' _("Last Author")), - * 'locked' _("Locked"), _("locked") - * 'minor' _("Minor Edit"), _("minor") - * 'markup' _("Markup") - * 'size' _("Size") - * 'creator' _("Creator") - * 'owner' _("Owner") - * 'checkbox' selectable checkbox at the left. - * 'content' - * - * Special, custom columns: Either theme or plugin (WikiAdmin*) specific. - * 'remove' _("Remove") - * 'perm' _("Permission Mask") - * 'acl' _("ACL") - * 'renamed_pagename' _("Rename to") - * 'ratingwidget', ... wikilens theme specific. - * 'custom' See plugin/_WikiTranslation - * - * Symbolic 'info=' arguments: - * 'all' All columns except the special columns - * 'most' pagename, mtime, author, size, hits, ... - * 'some' pagename, mtime, author - * * FIXME: In this refactoring I (Jeff) have un-implemented _ctime, _cauthor, and * number-of-revision. Note the _ctime and _cauthor as they were implemented * were somewhat flawed: revision 1 of a page doesn't have to exist in the This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2010-10-01 11:46:05
|
Revision: 7710 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7710&view=rev Author: vargenau Date: 2010-10-01 11:45:58 +0000 (Fri, 01 Oct 2010) Log Message: ----------- Set width to 100% for pagers Modified Paths: -------------- trunk/lib/PageList.php Modified: trunk/lib/PageList.php =================================================================== --- trunk/lib/PageList.php 2010-09-30 15:48:54 UTC (rev 7709) +++ trunk/lib/PageList.php 2010-10-01 11:45:58 UTC (rev 7710) @@ -195,7 +195,7 @@ return $page_handle->get($this->_field); } } - + function _getSortableValue ($page_handle, &$revision_handle) { $val = $this->_getValue($page_handle, $revision_handle); if ($this->_field == 'hits') @@ -226,7 +226,7 @@ $this->_getValue($pagelist, $page_handle, $revision_handle), HTML::raw(' ')); } - + function _getValue (&$pagelist, $page_handle, &$revision_handle) { if (!$revision_handle or (!$revision_handle->_data['%content'] or $revision_handle->_data['%content'] === true)) { @@ -239,7 +239,7 @@ unset($revision_handle->_data['%content']); return $size; } - + function _getSortableValue ($page_handle, &$revision_handle) { if (!$revision_handle) $revision_handle = $page_handle->getCurrentRevision(true); @@ -358,7 +358,7 @@ '»'.$this->search.'«'); } } - + function _getValue ($page_handle, &$revision_handle) { if (!$revision_handle or (!$revision_handle->_data['%content'] or $revision_handle->_data['%content'] === true)) { @@ -452,7 +452,7 @@ else return $author; } - + function _getSortableValue ($page_handle, &$revision_handle) { return _PageList_Column::_getValue($page_handle, $revision_handle); } @@ -714,11 +714,11 @@ 'external' => null, ); } - + function pagingArgs() { return array('sortby','limit','paging','count','dosort'); } - + function clearArg($arg_name) { if (isset($this->_options[$arg_name])) unset($this->_options[$arg_name]); @@ -804,7 +804,7 @@ or (!empty($this->_excluded_pages) and in_array($page_handle->getName(), $this->_excluded_pages))) return; // exclude page. - + // enforce view permission if (!mayAccessPage('view', $page_handle->getName())) return; @@ -927,7 +927,7 @@ function asXML() { return AsXML($this->getContent()); } - + /** * Handle sortby requests for the DB iterator and table header links. * Prefix the column with + or - like "+pagename","-mtime", ... @@ -936,7 +936,7 @@ * 'init' : unify with predefined order. "pagename" => "+pagename" * 'flip_order' : "mtime" => "+mtime" => "-mtime" ... * 'db' : "-pagename" => "pagename DESC" - * 'check' : + * 'check' : * * Now all columns are sortable. (patch by DanFr) * Some columns have native DB backend methods, some not. @@ -1454,11 +1454,11 @@ } return $tokens; } - + // make a table given the caption function _generateTable($caption) { if (count($this->_sortby) > 0) $this->_sortPages(); - + // wikiadminutils hack. that's a way to pagelist non-pages $rows = isset($this->_rows) ? $this->_rows : array(); $i = 0; @@ -1582,7 +1582,7 @@ $this->_options['limit']); if ($tokens) { $paging = Template("pagelink", $tokens); - $out->pushContent(HTML::table(array('width'=>'50%'), $paging)); + $out->pushContent(HTML::table(array('width'=>'100%'), $paging)); } } @@ -1614,7 +1614,7 @@ $cols)); return $out; } - + // Ignore azhead if not sorted by pagename if (!empty($this->_options['azhead']) and strstr($this->sortby($this->_options['sortby'], 'init'), "pagename") @@ -1693,7 +1693,7 @@ } $out->pushContent($list); if ( $do_paging and $tokens ) { - $out->pushContent(HTML::table($paging)); + $out->pushContent(HTML::table(array('width'=>'100%'), $paging)); } return $out; } @@ -1734,7 +1734,7 @@ } return $html; } - + function _emptyList($caption) { $html = HTML(); if ($caption) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ru...@us...> - 2010-11-11 14:45:25
|
Revision: 7740 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7740&view=rev Author: rurban Date: 2010-11-11 14:45:18 +0000 (Thu, 11 Nov 2010) Log Message: ----------- fix wrong explodePageList logic with *,*: union not intersection Modified Paths: -------------- trunk/lib/PageList.php Modified: trunk/lib/PageList.php =================================================================== --- trunk/lib/PageList.php 2010-11-10 16:51:32 UTC (rev 7739) +++ trunk/lib/PageList.php 2010-11-11 14:45:18 UTC (rev 7740) @@ -1040,7 +1040,7 @@ // expand wildcards from list of all pages if (preg_match('/[\?\*]/', $input) or substr($input,0,1) == "^") { include_once("lib/TextSearchQuery.php"); - $search = new TextSearchQuery(str_replace(",", " ", $input), true, + $search = new TextSearchQuery(str_replace(",", " or ", $input), true, (substr($input,0,1) == "^") ? 'posix' : 'glob'); $dbi = $GLOBALS['request']->getDbh(); $iter = $dbi->titleSearch($search, $sortby, $limit, $exclude); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2012-10-01 15:00:07
|
Revision: 8360 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=8360&view=rev Author: vargenau Date: 2012-10-01 14:59:57 +0000 (Mon, 01 Oct 2012) Log Message: ----------- Remove $id Modified Paths: -------------- trunk/lib/PageList.php Modified: trunk/lib/PageList.php =================================================================== --- trunk/lib/PageList.php 2012-10-01 14:59:03 UTC (rev 8359) +++ trunk/lib/PageList.php 2012-10-01 14:59:57 UTC (rev 8360) @@ -1,5 +1,4 @@ <?php -//$Id: PageList.php 8281 2012-08-31 12:01:01Z vargenau $ /* Copyright (C) 2004-2010 $ThePhpWikiProgrammingTeam * Copyright (C) 2008-2010 Marc-Etienne Vargenau, Alcatel-Lucent * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2012-11-14 16:24:48
|
Revision: 8449 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=8449&view=rev Author: vargenau Date: 2012-11-14 16:24:39 +0000 (Wed, 14 Nov 2012) Log Message: ----------- Remove empty lines Modified Paths: -------------- trunk/lib/PageList.php Modified: trunk/lib/PageList.php =================================================================== --- trunk/lib/PageList.php 2012-11-14 16:23:06 UTC (rev 8448) +++ trunk/lib/PageList.php 2012-11-14 16:24:39 UTC (rev 8449) @@ -176,8 +176,6 @@ } } - - class _PageList_Column extends _PageList_Column_base { function _PageList_Column($field, $default_heading, $align = false) @@ -216,8 +214,6 @@ } } - - /* overcome a call_user_func limitation by not being able to do: * call_user_func_array(array(&$class, $class_name), $params); * So we need $class = new $classname($params); @@ -289,8 +285,6 @@ } } - - class _PageList_Column_checkbox extends _PageList_Column { function _PageList_Column_checkbox($field, $default_heading, $name = 'p') @@ -341,8 +335,6 @@ } } - - class _PageList_Column_time extends _PageList_Column { function _PageList_Column_time($field, $default_heading) @@ -364,8 +356,6 @@ } } - - class _PageList_Column_version extends _PageList_Column { function _getValue($page_handle, &$revision_handle) @@ -376,8 +366,6 @@ } } - - // Output is hardcoded to limit of first 50 bytes. Otherwise // on very large Wikis this will fail if used with AllPages // (PHP memory limit exceeded) @@ -485,9 +473,6 @@ } } - - - class _PageList_Column_author extends _PageList_Column { function _PageList_Column_author($field, $default_heading, $align = false) @@ -511,8 +496,6 @@ } } - - class _PageList_Column_owner extends _PageList_Column_author { function _getValue($page_handle, &$revision_handle) @@ -530,8 +513,6 @@ } } - - class _PageList_Column_creator extends _PageList_Column_author { function _getValue($page_handle, &$revision_handle) @@ -549,8 +530,6 @@ } } - - class _PageList_Column_pagename extends _PageList_Column_base { var $_field = 'pagename'; @@ -584,8 +563,6 @@ } } - - class _PageList_Column_perm extends _PageList_Column { function _getValue($page_handle, &$revision_handle) @@ -597,8 +574,6 @@ } } - - class _PageList_Column_acl extends _PageList_Column { function _getValue($page_handle, &$revision_handle) @@ -621,8 +596,6 @@ } } - - class PageList { var $_group_rows = 3; @@ -1875,8 +1848,6 @@ } - - /* List pages with checkboxes to select from. * The [Select] button toggles via Javascript flipAll */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2013-02-06 09:52:29
|
Revision: 8724 http://sourceforge.net/p/phpwiki/code/8724 Author: vargenau Date: 2013-02-06 09:52:26 +0000 (Wed, 06 Feb 2013) Log Message: ----------- Fix typo: HTLM; update Phpdoc; rename _getValue to _getValuePageList when 3 params Modified Paths: -------------- trunk/lib/PageList.php Modified: trunk/lib/PageList.php =================================================================== --- trunk/lib/PageList.php 2013-02-06 09:49:04 UTC (rev 8723) +++ trunk/lib/PageList.php 2013-02-06 09:52:26 UTC (rev 8724) @@ -157,10 +157,10 @@ * An undefined value is defined to be < than the smallest defined value. * This base class _compare only works if the value is simple (e.g., a number). * - * @param $colvala $this->_getValue() of column a - * @param $colvalb $this->_getValue() of column b + * @param mixed $colvala $this->_getValue() of column a + * @param mixed $colvalb $this->_getValue() of column b * - * @return -1 if $a < $b, 1 if $a > $b, 0 otherwise. + * @return int -1 if $a < $b, 1 if $a > $b, 0 otherwise. */ function _compare($colvala, $colvalb) { @@ -234,11 +234,11 @@ { return HTML::td($this->_tdattr, HTML::raw(' '), - $this->_getValue($pagelist, $page_handle, $revision_handle), + $this->_getValuePageList($pagelist, $page_handle, $revision_handle), HTML::raw(' ')); } - function _getValue(&$pagelist, $page_handle, &$revision_handle) + function _getValuePageList($pagelist, $page_handle, &$revision_handle) { if (!$revision_handle or (!$revision_handle->_data['%content'] or $revision_handle->_data['%content'] === true) @@ -299,7 +299,7 @@ $this->_PageList_Column($field, $heading, 'center'); } - function _getValue($pagelist, $page_handle, &$revision_handle) + function _getValuePageList($pagelist, $page_handle, &$revision_handle) { $pagename = $page_handle->getName(); $selected = !empty($pagelist->_selected[$pagename]); @@ -322,7 +322,7 @@ { return HTML::td($this->_tdattr, HTML::raw(' '), - $this->_getValue($pagelist, $page_handle, $revision_handle), + $this->_getValuePageList($pagelist, $page_handle, $revision_handle), HTML::raw(' ')); } @@ -785,7 +785,7 @@ } /** - * @param caption string or HTML + * @param mixed $caption string or HTML */ function setCaption($caption) { @@ -793,7 +793,7 @@ } /** - * @param caption string or HTML + * @param mixed $caption string or HTML */ function addCaption($caption) { @@ -1342,8 +1342,8 @@ * column will only be added the first time, and ignored the succeeding times. * If you wish to add multiple columns of the same type, use addColumnObject(). * - * @param column name - * @return true if column is added, false otherwise + * @param string column name + * @return bool true if column is added, false otherwise */ function _addColumn($column) { @@ -1822,7 +1822,7 @@ function _generateCommaList($style = false) { if (defined($this->_options['commasep'])) - $seperator = HTLM::Raw($this->_options['commasep']); + $seperator = HTML::Raw($this->_options['commasep']); else $seperator = ', '; $html = HTML(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2013-02-15 15:59:59
|
Revision: 8730 http://sourceforge.net/p/phpwiki/code/8730 Author: vargenau Date: 2013-02-15 15:59:57 +0000 (Fri, 15 Feb 2013) Log Message: ----------- Remove & Modified Paths: -------------- trunk/lib/PageList.php Modified: trunk/lib/PageList.php =================================================================== --- trunk/lib/PageList.php 2013-02-15 15:17:49 UTC (rev 8729) +++ trunk/lib/PageList.php 2013-02-15 15:59:57 UTC (rev 8730) @@ -230,7 +230,7 @@ class _PageList_Column_size extends _PageList_Column { - function format(&$pagelist, $page_handle, &$revision_handle) + function format($pagelist, $page_handle, &$revision_handle) { return HTML::td($this->_tdattr, HTML::raw(' '), This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2013-02-15 16:26:33
|
Revision: 8733 http://sourceforge.net/p/phpwiki/code/8733 Author: vargenau Date: 2013-02-15 16:26:30 +0000 (Fri, 15 Feb 2013) Log Message: ----------- Remove & Modified Paths: -------------- trunk/lib/PageList.php Modified: trunk/lib/PageList.php =================================================================== --- trunk/lib/PageList.php 2013-02-15 16:04:19 UTC (rev 8732) +++ trunk/lib/PageList.php 2013-02-15 16:26:30 UTC (rev 8733) @@ -105,7 +105,7 @@ // new grid-style sortable heading // TODO: via activeui.js ? (fast dhtml sorting) - function button_heading(&$pagelist, $colNum) + function button_heading($pagelist, $colNum) { global $WikiTheme, $request; // allow sorting? @@ -933,7 +933,7 @@ $this->_options['count'] = $i; } - function addPageList(&$list) + function addPageList($list) { if (empty($list)) return; // Protect reset from a null arg if (isset($this->_options['limit'])) { // extract from,count from limit This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2013-06-14 10:20:54
|
Revision: 8807 http://sourceforge.net/p/phpwiki/code/8807 Author: vargenau Date: 2013-06-14 10:20:50 +0000 (Fri, 14 Jun 2013) Log Message: ----------- Translate quotes Modified Paths: -------------- trunk/lib/PageList.php Modified: trunk/lib/PageList.php =================================================================== --- trunk/lib/PageList.php 2013-06-14 09:53:55 UTC (rev 8806) +++ trunk/lib/PageList.php 2013-06-14 10:20:50 UTC (rev 8807) @@ -386,8 +386,7 @@ if (!$this->search and !empty($HTTP_POST_VARS['admin_replace'])) { $this->search = $HTTP_POST_VARS['admin_replace']['from']; } - $this->_heading .= sprintf(_(" ... around %s"), - '»' . $this->search . '«'); + $this->_heading .= sprintf(_(" ... around “%s”"), $this->search); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2013-07-18 09:20:03
|
Revision: 8834 http://sourceforge.net/p/phpwiki/code/8834 Author: vargenau Date: 2013-07-18 09:20:00 +0000 (Thu, 18 Jul 2013) Log Message: ----------- Add braces Modified Paths: -------------- trunk/lib/PageList.php Modified: trunk/lib/PageList.php =================================================================== --- trunk/lib/PageList.php 2013-07-18 09:19:23 UTC (rev 8833) +++ trunk/lib/PageList.php 2013-07-18 09:20:00 UTC (rev 8834) @@ -1099,8 +1099,12 @@ function explodePageList($input, $include_empty = false, $sortby = '', $limit = '', $exclude = '') { - if (empty($input)) return array(); - if (is_array($input)) return $input; + if (empty($input)) { + return array(); + } + if (is_array($input)) { + return $input; + } // expand wildcards from list of all pages if (preg_match('/[\?\*]/', $input) or substr($input, 0, 1) == "^") { include_once 'lib/TextSearchQuery.php'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2014-06-04 13:08:48
|
Revision: 8864 http://sourceforge.net/p/phpwiki/code/8864 Author: vargenau Date: 2014-06-04 13:08:43 +0000 (Wed, 04 Jun 2014) Log Message: ----------- Use CSS Modified Paths: -------------- trunk/lib/PageList.php Modified: trunk/lib/PageList.php =================================================================== --- trunk/lib/PageList.php 2014-06-04 12:58:57 UTC (rev 8863) +++ trunk/lib/PageList.php 2014-06-04 13:08:43 UTC (rev 8864) @@ -1557,7 +1557,7 @@ } $table = HTML::table(array('class' => 'fullwidth pagelist')); if ($caption) { - $table->pushContent(HTML::caption(array('align' => 'top'), $caption)); + $table->pushContent(HTML::caption(array('class' => 'top'), $caption)); } $row = HTML::tr(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2014-06-12 15:10:10
|
Revision: 8893 http://sourceforge.net/p/phpwiki/code/8893 Author: vargenau Date: 2014-06-12 15:10:07 +0000 (Thu, 12 Jun 2014) Log Message: ----------- Use CSS Modified Paths: -------------- trunk/lib/PageList.php Modified: trunk/lib/PageList.php =================================================================== --- trunk/lib/PageList.php 2014-06-12 14:33:34 UTC (rev 8892) +++ trunk/lib/PageList.php 2014-06-12 15:10:07 UTC (rev 8893) @@ -1677,13 +1677,13 @@ for ($i = $offset; $i < $offset + $count; $i += $length) { $this->_saveOptions(array('cols' => 0, 'paging' => 'none')); $this->_pages = array_slice($this->_pages, $i, $length); - $cols->pushContent(HTML::td( /*array('width' => $width),*/ - $this->_generateList())); + $cols->pushContent(HTML::td($this->_generateList())); $this->_restoreOptions(); } // speed up table rendering by defining colgroups $out->pushContent(HTML::table(HTML::colgroup - (array('span' => $this->_options['cols'], 'width' => $width)), + (array('span' => $this->_options['cols'], + 'style' => 'width: '.$width)), $cols)); return $out; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2014-07-18 10:11:40
|
Revision: 8987 http://sourceforge.net/p/phpwiki/code/8987 Author: vargenau Date: 2014-07-18 10:11:37 +0000 (Fri, 18 Jul 2014) Log Message: ----------- Use __construct Modified Paths: -------------- trunk/lib/PageList.php Modified: trunk/lib/PageList.php =================================================================== --- trunk/lib/PageList.php 2014-07-18 09:44:34 UTC (rev 8986) +++ trunk/lib/PageList.php 2014-07-18 10:11:37 UTC (rev 8987) @@ -52,7 +52,7 @@ { public $_tdattr = array(); - function _PageList_Column_base($default_heading, $align = false) + function __construct($default_heading, $align = false) { $this->_heading = $default_heading; @@ -271,7 +271,7 @@ function _getValue($page_handle, &$revision_handle) { //FIXME: check if $this is available in the parent (->need_rev) - $val = _PageList_Column::_getValue($page_handle, $revision_handle); + $val = parent::_getValue($page_handle, $revision_handle); return $val ? $this->_textIfTrue : $this->_textIfFalse; } } @@ -362,7 +362,7 @@ function __construct($field, $default_heading, $align = false, $search = false, $hilight_re = false) { - $this->_PageList_Column($field, $default_heading, $align); + parent::__construct($field, $default_heading, $align); $this->bytes = 50; $this->search = $search; $this->hilight_re = $hilight_re; @@ -453,7 +453,7 @@ return $page_handle->score; elseif (is_array($page_handle) and !empty($page_handle['score'])) return $page_handle['score']; else - return substr(_PageList_Column::_getValue($page_handle, $revision_handle), 0, 50); + return substr(parent::_getValue($page_handle, $revision_handle), 0, 50); } } @@ -467,7 +467,7 @@ function _getValue($page_handle, &$revision_handle) { - $author = _PageList_Column::_getValue($page_handle, $revision_handle); + $author = parent::_getValue($page_handle, $revision_handle); if ($this->dbi->isWikiPage($author)) return WikiLink($author); else @@ -476,7 +476,7 @@ function _getSortableValue($page_handle, &$revision_handle) { - return _PageList_Column::_getValue($page_handle, $revision_handle); + return parent::_getValue($page_handle, $revision_handle); } } @@ -510,7 +510,7 @@ function _getSortableValue($page_handle, &$revision_handle) { - return _PageList_Column::_getValue($page_handle, $revision_handle); + return parent::_getValue($page_handle, $revision_handle); } } @@ -518,9 +518,9 @@ { public $_field = 'pagename'; - function _PageList_Column_pagename() + function __construct() { - $this->_PageList_Column_base(_("Page Name")); + parent::__construct(_("Page Name")); global $request; $this->dbi = &$request->getDbh(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2014-09-18 12:50:10
|
Revision: 9087 http://sourceforge.net/p/phpwiki/code/9087 Author: vargenau Date: 2014-09-18 12:50:01 +0000 (Thu, 18 Sep 2014) Log Message: ----------- Make functions static Modified Paths: -------------- trunk/lib/PageList.php Modified: trunk/lib/PageList.php =================================================================== --- trunk/lib/PageList.php 2014-09-18 08:28:23 UTC (rev 9086) +++ trunk/lib/PageList.php 2014-09-18 12:50:01 UTC (rev 9087) @@ -1124,7 +1124,7 @@ } // TODO: optimize getTotal => store in count - function allPagesByAuthor($wildcard, $include_empty = false, $sortby = '', + static function allPagesByAuthor($wildcard, $include_empty = false, $sortby = '', $limit = '', $exclude = '') { $dbi = $GLOBALS['request']->getDbh(); @@ -1151,7 +1151,7 @@ return $allPages; } - function allPagesByOwner($wildcard, $include_empty = false, $sortby = '', + static function allPagesByOwner($wildcard, $include_empty = false, $sortby = '', $limit = '', $exclude = '') { $dbi = $GLOBALS['request']->getDbh(); @@ -1177,7 +1177,7 @@ return $allPages; } - function allPagesByCreator($wildcard, $include_empty = false, $sortby = '', + static function allPagesByCreator($wildcard, $include_empty = false, $sortby = '', $limit = '', $exclude = '') { $dbi = $GLOBALS['request']->getDbh(); @@ -1204,7 +1204,7 @@ } // UserPages are pages NOT owned by ADMIN_USER - function allUserPages($include_empty = false, $sortby = '', + static function allUserPages($include_empty = false, $sortby = '', $limit = '', $exclude = '') { $dbi = $GLOBALS['request']->getDbh(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2014-09-18 13:32:16
|
Revision: 9089 http://sourceforge.net/p/phpwiki/code/9089 Author: vargenau Date: 2014-09-18 13:32:14 +0000 (Thu, 18 Sep 2014) Log Message: ----------- Add static, type compatibility Modified Paths: -------------- trunk/lib/PageList.php Modified: trunk/lib/PageList.php =================================================================== --- trunk/lib/PageList.php 2014-09-18 13:31:16 UTC (rev 9088) +++ trunk/lib/PageList.php 2014-09-18 13:32:14 UTC (rev 9089) @@ -595,7 +595,7 @@ public $_sortby = array(); public $_maxlen = 0; - function __construct($columns = false, $exclude = false, $options = false) + function __construct($columns = false, $exclude = false, $options = array()) { // unique id per pagelist on each page. if (!isset($GLOBALS['request']->_pagelist)) @@ -703,7 +703,7 @@ // 1: info, 2: exclude, 3: hash of options // Here we declare which options are supported, so that // the calling plugin may simply merge this with its own default arguments - function supportedArgs() + static function supportedArgs() { // Todo: add all supported Columns, like locked, minor, ... return array( // Currently supported options: @@ -1830,7 +1830,7 @@ extends PageList { - function __construct($columns = false, $exclude = '', $options = false) + function __construct($columns = false, $exclude = '', $options = array()) { if ($columns) { if (!is_array($columns)) @@ -1861,7 +1861,7 @@ extends PageList { - function __construct($columns = false, $exclude = '', $options = false) + function __construct($columns = false, $exclude = '', $options = array()) { if ($columns) { if (!is_array($columns)) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2014-09-19 12:57:06
|
Revision: 9099 http://sourceforge.net/p/phpwiki/code/9099 Author: vargenau Date: 2014-09-19 12:57:02 +0000 (Fri, 19 Sep 2014) Log Message: ----------- Add return value Modified Paths: -------------- trunk/lib/PageList.php Modified: trunk/lib/PageList.php =================================================================== --- trunk/lib/PageList.php 2014-09-19 12:44:06 UTC (rev 9098) +++ trunk/lib/PageList.php 2014-09-19 12:57:02 UTC (rev 9099) @@ -850,18 +850,18 @@ //FIXME. only on sf.net if (!is_object($page_handle)) { trigger_error("PageList: Invalid page_handle $page_handle", E_USER_WARNING); - return; + return false; } if (!isset($page_handle) or empty($page_handle) or (!empty($this->_excluded_pages) - and in_array($page_handle->getName(), $this->_excluded_pages)) - ) - return; // exclude page. - + and in_array($page_handle->getName(), $this->_excluded_pages))) { + return false; // exclude page. + } // enforce view permission - if (!mayAccessPage('view', $page_handle->getName())) - return; + if (!mayAccessPage('view', $page_handle->getName())) { + return false; + } $group = (int)($i / $this->_group_rows); $class = ($group % 2) ? 'oddrow' : 'evenrow'; @@ -1626,7 +1626,9 @@ // FIXME: only unique list entries, esp. with nopage function _generateList($caption = '') { - if (empty($this->_pages)) return; // stop recursion + if (empty($this->_pages)) { + return false; // stop recursion + } if (!isset($this->_options['listtype'])) $this->_options['listtype'] = ''; foreach ($this->_pages as $pagenum => $page) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2014-09-26 09:03:24
|
Revision: 9120 http://sourceforge.net/p/phpwiki/code/9120 Author: vargenau Date: 2014-09-26 09:03:15 +0000 (Fri, 26 Sep 2014) Log Message: ----------- Test page_handle is an object Modified Paths: -------------- trunk/lib/PageList.php Modified: trunk/lib/PageList.php =================================================================== --- trunk/lib/PageList.php 2014-09-26 08:58:04 UTC (rev 9119) +++ trunk/lib/PageList.php 2014-09-26 09:03:15 UTC (rev 9120) @@ -826,7 +826,9 @@ $pages = array(); $limit = @$this->_options['limit']; foreach ($this->_pages as $page_handle) { - $pages[] = $page_handle->getName(); + if (is_object($page_handle)) { + $pages[] = $page_handle->getName(); + } if ($limit and count($pages) > $limit) break; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2014-09-26 09:23:41
|
Revision: 9121 http://sourceforge.net/p/phpwiki/code/9121 Author: vargenau Date: 2014-09-26 09:23:38 +0000 (Fri, 26 Sep 2014) Log Message: ----------- wiki: fix pageNames Modified Paths: -------------- trunk/lib/PageList.php Modified: trunk/lib/PageList.php =================================================================== --- trunk/lib/PageList.php 2014-09-26 09:03:15 UTC (rev 9120) +++ trunk/lib/PageList.php 2014-09-26 09:23:38 UTC (rev 9121) @@ -828,6 +828,8 @@ foreach ($this->_pages as $page_handle) { if (is_object($page_handle)) { $pages[] = $page_handle->getName(); + } else { + $pages[] = $page_handle; } if ($limit and count($pages) > $limit) break; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2014-10-01 15:33:59
|
Revision: 9150 http://sourceforge.net/p/phpwiki/code/9150 Author: vargenau Date: 2014-10-01 15:33:50 +0000 (Wed, 01 Oct 2014) Log Message: ----------- PHP Doc update Modified Paths: -------------- trunk/lib/PageList.php Modified: trunk/lib/PageList.php =================================================================== --- trunk/lib/PageList.php 2014-10-01 15:28:36 UTC (rev 9149) +++ trunk/lib/PageList.php 2014-10-01 15:33:50 UTC (rev 9150) @@ -971,6 +971,9 @@ return false; } + /** + * @return bool|WikiDB_Page + */ function first() { if (count($this->_pages) > 0) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2014-10-01 16:13:26
|
Revision: 9152 http://sourceforge.net/p/phpwiki/code/9152 Author: vargenau Date: 2014-10-01 16:13:18 +0000 (Wed, 01 Oct 2014) Log Message: ----------- Type compatibility Modified Paths: -------------- trunk/lib/PageList.php Modified: trunk/lib/PageList.php =================================================================== --- trunk/lib/PageList.php 2014-10-01 16:12:28 UTC (rev 9151) +++ trunk/lib/PageList.php 2014-10-01 16:13:18 UTC (rev 9152) @@ -605,7 +605,7 @@ public $_sortby = array(); public $_maxlen = 0; - function __construct($columns = false, $exclude = false, $options = array()) + function __construct($columns = array(), $exclude = array(), $options = array()) { // unique id per pagelist on each page. if (!isset($GLOBALS['request']->_pagelist)) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2014-11-17 16:25:19
|
Revision: 9326 http://sourceforge.net/p/phpwiki/code/9326 Author: vargenau Date: 2014-11-17 16:25:16 +0000 (Mon, 17 Nov 2014) Log Message: ----------- function explodePageList is static Modified Paths: -------------- trunk/lib/PageList.php Modified: trunk/lib/PageList.php =================================================================== --- trunk/lib/PageList.php 2014-11-17 16:23:34 UTC (rev 9325) +++ trunk/lib/PageList.php 2014-11-17 16:25:16 UTC (rev 9326) @@ -1113,8 +1113,8 @@ * Limitation: Doesn't split into comma-sep and then expand wildcards. * "Test1*,Test2*" is expanded into TextSearch "Test1* Test2*" */ - function explodePageList($input, $include_empty = false, $sortby = '', - $limit = '', $exclude = '') + static function explodePageList($input, $include_empty = false, $sortby = '', + $limit = '', $exclude = '') { if (empty($input)) { return array(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2014-12-01 13:17:55
|
Revision: 9392 http://sourceforge.net/p/phpwiki/code/9392 Author: vargenau Date: 2014-12-01 13:17:52 +0000 (Mon, 01 Dec 2014) Log Message: ----------- Use default value Modified Paths: -------------- trunk/lib/PageList.php Modified: trunk/lib/PageList.php =================================================================== --- trunk/lib/PageList.php 2014-12-01 09:23:39 UTC (rev 9391) +++ trunk/lib/PageList.php 2014-12-01 13:17:52 UTC (rev 9392) @@ -447,7 +447,7 @@ } include_once 'lib/BlockParser.php'; // false --> don't bother processing hrefs for embedded WikiLinks - $ct = TransformText($c, false); + $ct = TransformText($c); if (empty($pagelist->_sortby[$this->_field])) unset($revision_handle->_data['%pagedata']['_cached_html']); return HTML::div(array('style' => 'font-size:x-small'), This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2014-12-04 13:41:46
|
Revision: 9415 http://sourceforge.net/p/phpwiki/code/9415 Author: vargenau Date: 2014-12-04 13:41:43 +0000 (Thu, 04 Dec 2014) Log Message: ----------- Rename private functions without underscore Modified Paths: -------------- trunk/lib/PageList.php Modified: trunk/lib/PageList.php =================================================================== --- trunk/lib/PageList.php 2014-12-04 13:18:15 UTC (rev 9414) +++ trunk/lib/PageList.php 2014-12-04 13:41:43 UTC (rev 9415) @@ -631,7 +631,7 @@ if ($options) $this->_options = $options; - $this->_initAvailableColumns(); + $this->initAvailableColumns(); // let plugins predefine only certain objects, such its own custom pagelist columns $symbolic_columns = array( @@ -849,7 +849,7 @@ return $pages; } - private function _getPageFromHandle($page_handle) + private function getPageFromHandle($page_handle) { /** * @var WikiRequest $request @@ -868,9 +868,9 @@ * Take a PageList_Page object, and return an HTML object to display * it in a table or list row. */ - private function _renderPageRow(&$page_handle, $i = 0) + private function renderPageRow(&$page_handle, $i = 0) { - $page_handle = $this->_getPageFromHandle($page_handle); + $page_handle = $this->getPageFromHandle($page_handle); //FIXME. only on sf.net if (!is_object($page_handle)) { trigger_error("PageList: Invalid page_handle $page_handle", E_USER_WARNING); @@ -1000,8 +1000,8 @@ 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 + return $this->generateList($caption); elseif (count($this->_columns) == 1) + return $this->generateList($caption); else return $this->_generateTable($caption); } @@ -1106,7 +1106,7 @@ or (method_exists($request->_dbi->_backend, 'sortable_columns') and (in_array($column, $request->_dbi->_backend->sortable_columns()))) ) { - // omit this sort method from the _sortPages call at rendering + // omit this sort method from the sortPages call at rendering // asc or desc: +pagename, -pagename return $column . ($order == '+' ? ' ASC' : ' DESC'); } else { @@ -1274,7 +1274,7 @@ * If the pageList is initialized with $options['types'] these types are also initialized, * overriding the standard types. */ - private function _initAvailableColumns() + private function initAvailableColumns() { global $customPageListColumns; $standard_types = @@ -1381,7 +1381,7 @@ if (isset($this->_columns_seen[$column])) return false; // Already have this one. if (!isset($this->_types[$column])) - $this->_initAvailableColumns(); + $this->initAvailableColumns(); $this->_columns_seen[$column] = true; if (strstr($column, ':')) @@ -1436,15 +1436,15 @@ /** * 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 return 0; } else { - $pagea = $this->_getPageFromHandle($a); // If a string, convert to page + $pagea = $this->getPageFromHandle($a); // If a string, convert to page assert(is_a($pagea, 'WikiDB_Page')); - $pageb = $this->_getPageFromHandle($b); // If a string, convert to page + $pageb = $this->getPageFromHandle($b); // If a string, convert to page assert(is_a($pageb, 'WikiDB_Page')); foreach ($this->_sortby as $colNum => $direction) { // get column type object @@ -1480,7 +1480,7 @@ * If the sortby cols are already sorted by the DB call, don't do usort. * TODO: optimize for multiple sortable cols */ - private function _sortPages() + private function sortPages() { if (count($this->_sortby) > 0) { $need_sort = $this->_options['dosort']; @@ -1491,7 +1491,7 @@ } if ($need_sort) { // There are some columns to sort by // TODO: consider nopage - usort($this->_pages, array($this, '_pageCompare')); + usort($this->_pages, array($this, 'pageCompare')); } } } @@ -1588,7 +1588,7 @@ // make a table given the caption public function _generateTable($caption = '') { - if (count($this->_sortby) > 0) $this->_sortPages(); + if (count($this->_sortby) > 0) $this->sortPages(); // wikiadminutils hack. that's a way to pagelist non-pages $rows = isset($this->_rows) ? $this->_rows : array(); @@ -1606,7 +1606,7 @@ $this->_pages = array_slice($this->_pages, $tokens['OFFSET'], $tokens['SIZE']); } foreach ($this->_pages as $pagenum => $page) { - $one_row = $this->_renderPageRow($page, $i++); + $one_row = $this->renderPageRow($page, $i++); $rows[] = $one_row; } $table = HTML::table(array('class' => 'fullwidth pagelist')); @@ -1650,7 +1650,7 @@ } /* recursive stack for private sublist options (azhead, cols) */ - private function _saveOptions($opts) + private function saveOptions($opts) { $stack = array('pages' => $this->_pages); foreach ($opts as $k => $v) { @@ -1662,7 +1662,7 @@ $this->_stack->push($stack); } - private function _restoreOptions() + private function restoreOptions() { assert($this->_stack); $stack = $this->_stack->pop(); @@ -1678,7 +1678,7 @@ // 'ordered' - OL or UL list (not yet inherited to all plugins) // 'comma' - condensed comma-list only, 1: no links, >1: with links // FIXME: only unique list entries, esp. with nopage - private function _generateList($caption = '') + private function generateList($caption = '') { if (empty($this->_pages)) { return false; // stop recursion @@ -1686,7 +1686,7 @@ if (!isset($this->_options['listtype'])) $this->_options['listtype'] = ''; foreach ($this->_pages as $pagenum => $page) { - $one_row = $this->_renderPageRow($page); + $one_row = $this->renderPageRow($page); $rows[] = array('header' => WikiLink($page), 'render' => $one_row); } $out = HTML(); @@ -1698,7 +1698,7 @@ if (!is_array($this->_pages[0]) and is_string($this->_pages[0])) { $this->_pages = array_unique($this->_pages); } - if (count($this->_sortby) > 0) $this->_sortPages(); + if (count($this->_sortby) > 0) $this->sortPages(); $count = $this->getTotal(); $do_paging = (isset($this->_options['paging']) and !empty($this->_options['limit']) @@ -1731,10 +1731,10 @@ $width = sprintf("%d", 100 / $this->_options['cols']) . '%'; $cols = HTML::tr(array('class' => 'top')); for ($i = $offset; $i < $offset + $count; $i += $length) { - $this->_saveOptions(array('cols' => 0, 'paging' => 'none')); + $this->saveOptions(array('cols' => 0, 'paging' => 'none')); $this->_pages = array_slice($this->_pages, $i, $length); - $cols->pushContent(HTML::td($this->_generateList())); - $this->_restoreOptions(); + $cols->pushContent(HTML::td($this->generateList())); + $this->restoreOptions(); } // speed up table rendering by defining colgroups $out->pushContent(HTML::table(HTML::colgroup @@ -1756,20 +1756,20 @@ $page =& $this->_pages[$i]; $h = substr($page->getName(), 0, 1); if ($h != $cur_h and $i > $j) { - $this->_saveOptions(array('cols' => 0, 'azhead' => 0, 'ordered' => $j + 1)); + $this->saveOptions(array('cols' => 0, 'azhead' => 0, 'ordered' => $j + 1)); $this->_pages = array_slice($this->_pages, $j, $i - $j); - $out->pushContent($this->_generateList()); - $this->_restoreOptions(); + $out->pushContent($this->generateList()); + $this->restoreOptions(); $j = $i; $out->pushContent(HTML::h3($h)); $cur_h = $h; } } if ($i > $j) { // flush the rest - $this->_saveOptions(array('cols' => 0, 'azhead' => 0, 'ordered' => $j + 1)); + $this->saveOptions(array('cols' => 0, 'azhead' => 0, 'ordered' => $j + 1)); $this->_pages = array_slice($this->_pages, $j, $i - $j); - $out->pushContent($this->_generateList()); - $this->_restoreOptions(); + $out->pushContent($this->generateList()); + $this->restoreOptions(); } return $out; } @@ -1778,9 +1778,9 @@ $this->_options['comma'] = 2; if (!empty($this->_options['comma'])) { if ($this->_options['comma'] == 1) - $out->pushContent($this->_generateCommaListAsString()); + $out->pushContent($this->generateCommaListAsString()); else - $out->pushContent($this->_generateCommaList()); + $out->pushContent($this->generateCommaList()); return $out; } @@ -1830,7 +1830,7 @@ // Condense list without a href links: "Page1, Page2, ..." // Alternative $seperator = HTML::Raw(' · ') // FIXME: only unique list entries, esp. with nopage - private function _generateCommaListAsString() + private function generateCommaListAsString() { if (defined($this->_options['commasep'])) $seperator = $this->_options['commasep']; @@ -1838,7 +1838,7 @@ $seperator = ', '; $pages = array(); foreach ($this->_pages as $pagenum => $page) { - if ($s = $this->_renderPageRow($page)) // some pages are not viewable + if ($s = $this->renderPageRow($page)) // some pages are not viewable $pages[] = is_string($s) ? $s : $s->asString(); } return HTML(join($seperator, $pages)); @@ -1849,17 +1849,17 @@ // Future: 1 = reserved for plain string (see above) // 2 and more => HTML link specialization? // FIXME: only unique list entries, esp. with nopage - private function _generateCommaList() + private function generateCommaList() { if (defined($this->_options['commasep'])) $seperator = HTML::raw($this->_options['commasep']); else $seperator = ', '; $html = HTML(); - $html->pushContent($this->_renderPageRow($this->_pages[0])); + $html->pushContent($this->renderPageRow($this->_pages[0])); next($this->_pages); foreach ($this->_pages as $pagenum => $page) { - if ($s = $this->_renderPageRow($page)) // some pages are not viewable + if ($s = $this->renderPageRow($page)) // some pages are not viewable $html->pushContent($seperator, $s); } return $html; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2014-12-04 16:19:37
|
Revision: 9419 http://sourceforge.net/p/phpwiki/code/9419 Author: vargenau Date: 2014-12-04 16:19:33 +0000 (Thu, 04 Dec 2014) Log Message: ----------- private $_columns_seen --> public Modified Paths: -------------- trunk/lib/PageList.php Modified: trunk/lib/PageList.php =================================================================== --- trunk/lib/PageList.php 2014-12-04 16:12:50 UTC (rev 9418) +++ trunk/lib/PageList.php 2014-12-04 16:19:33 UTC (rev 9419) @@ -610,7 +610,7 @@ public $_sortby = array(); public $_maxlen = 0; private $_messageIfEmpty = ''; - private $_columns_seen = array(); + public $_columns_seen = array(); private $_stack; function __construct($columns = array(), $exclude = array(), $options = array()) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2015-02-12 09:56:58
|
Revision: 9531 http://sourceforge.net/p/phpwiki/code/9531 Author: vargenau Date: 2015-02-12 09:56:50 +0000 (Thu, 12 Feb 2015) Log Message: ----------- Remove · Modified Paths: -------------- trunk/lib/PageList.php Modified: trunk/lib/PageList.php =================================================================== --- trunk/lib/PageList.php 2015-02-12 09:53:11 UTC (rev 9530) +++ trunk/lib/PageList.php 2015-02-12 09:56:50 UTC (rev 9531) @@ -1835,7 +1835,6 @@ // comma=1 // Condense list without a href links: "Page1, Page2, ..." - // Alternative $seperator = HTML::raw(' · ') // FIXME: only unique list entries, esp. with nopage private function generateCommaListAsString() { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |