From: <var...@us...> - 2008-08-29 13:30:05
|
Revision: 6221 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6221&view=rev Author: vargenau Date: 2008-08-29 13:30:14 +0000 (Fri, 29 Aug 2008) Log Message: ----------- Do not force image width and height Modified Paths: -------------- trunk/lib/PageList.php Modified: trunk/lib/PageList.php =================================================================== --- trunk/lib/PageList.php 2008-08-28 18:21:03 UTC (rev 6220) +++ trunk/lib/PageList.php 2008-08-29 13:30:14 UTC (rev 6221) @@ -126,8 +126,6 @@ $noimg_src = $WikiTheme->getButtonURL('no_order'); if ($noimg_src) $noimg = HTML::img(array('src' => $noimg_src, - 'width' => '7', - 'height' => '7', 'border' => 0, 'alt' => '.')); else @@ -147,8 +145,6 @@ $img->setAttr('alt', "."); } else { $img = HTML::img(array('src' => $src, - 'width' => '7', - 'height' => '7', 'border' => 0, 'alt' => _("Click to reverse sort order"))); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ru...@us...> - 2008-12-04 07:51:57
|
Revision: 6354 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6354&view=rev Author: rurban Date: 2008-12-04 07:51:53 +0000 (Thu, 04 Dec 2008) Log Message: ----------- PHP Fatal error: Cannot unset string offsets Modified Paths: -------------- trunk/lib/PageList.php Modified: trunk/lib/PageList.php =================================================================== --- trunk/lib/PageList.php 2008-12-04 07:50:10 UTC (rev 6353) +++ trunk/lib/PageList.php 2008-12-04 07:51:53 UTC (rev 6354) @@ -387,8 +387,11 @@ if (empty($pagelist->_sortby[$this->_field])) unset($revision_handle->_data['%content']); if ($this->_field == 'hi_content') { - if (!empty($revision_handle->_data['%pagedata'])) - unset($revision_handle->_data['%pagedata']['_cached_html']); + if (!empty($revision_handle->_data['%pagedata'])) { + $revision_handle->_data['%pagedata']['_cached_html'] = ''; + // PHP Fatal error: Cannot unset string offsets + //unset($revision_handle->_data['%pagedata']['_cached_html']); + } $search = $this->search; $score = ''; if (!empty($page_handle->score)) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2009-02-14 16:16:43
|
Revision: 6499 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6499&view=rev Author: vargenau Date: 2009-02-14 16:16:40 +0000 (Sat, 14 Feb 2009) Log Message: ----------- Table of 100% width Modified Paths: -------------- trunk/lib/PageList.php Modified: trunk/lib/PageList.php =================================================================== --- trunk/lib/PageList.php 2009-02-14 14:57:03 UTC (rev 6498) +++ trunk/lib/PageList.php 2009-02-14 16:16:40 UTC (rev 6499) @@ -292,7 +292,6 @@ $this->_name = $name; $heading = HTML::input(array('type' => 'button', 'title' => _("Click to de-/select all pages"), - //'width' => '100%', 'name' => $default_heading, 'value' => $default_heading, 'onclick' => "flipAll(this.form)" @@ -1411,11 +1410,11 @@ $table = HTML::table(array('cellpadding' => 0, 'cellspacing' => 1, 'border' => 0, + 'width' => '100%', 'class' => 'pagelist', )); if ($caption) { $table->pushContent(HTML::caption(array('align'=>'top'), $caption)); - $table->setAttr('width', '100%'); } //Warning: This is quite fragile. It depends solely on a private variable This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2009-03-01 18:54:28
|
Revision: 6615 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6615&view=rev Author: vargenau Date: 2009-03-01 18:54:26 +0000 (Sun, 01 Mar 2009) Log Message: ----------- Test isset to avoid warning Modified Paths: -------------- trunk/lib/PageList.php Modified: trunk/lib/PageList.php =================================================================== --- trunk/lib/PageList.php 2009-03-01 18:46:58 UTC (rev 6614) +++ trunk/lib/PageList.php 2009-03-01 18:54:26 UTC (rev 6615) @@ -1352,7 +1352,9 @@ $pagename = $request->getArg('pagename'); $defargs = array_merge(array('id' => $this->id), $request->args); if (USE_PATH_INFO) unset($defargs['pagename']); - if ($defargs['action'] == 'browse') unset($defargs['action']); + if (isset($defargs['action']) and ($defargs['action'] == 'browse')) { + unset($defargs['action']); + } $prev = $defargs; $tokens = array(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ru...@us...> - 2009-03-25 11:31:40
|
Revision: 6704 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6704&view=rev Author: rurban Date: 2009-03-25 11:31:37 +0000 (Wed, 25 Mar 2009) Log Message: ----------- notice uninitialized from Modified Paths: -------------- trunk/lib/PageList.php Modified: trunk/lib/PageList.php =================================================================== --- trunk/lib/PageList.php 2009-03-25 11:30:52 UTC (rev 6703) +++ trunk/lib/PageList.php 2009-03-25 11:31:37 UTC (rev 6704) @@ -794,7 +794,7 @@ /* ignore from, but honor limit */ function addPages ($page_iter) { // TODO: if limit check max(strlen(pagename)) - $i = 0; + $i = 0; $from = 0; if (isa($page_iter->_iter, "WikiDB_backend_dbaBase_pageiter")) { $limit = 0; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2009-03-27 10:07:31
|
Revision: 6724 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6724&view=rev Author: vargenau Date: 2009-03-27 10:07:24 +0000 (Fri, 27 Mar 2009) Log Message: ----------- jsFlipAll Javascript code was inserted inside the table, leading to invalid XHTML code. Better use a separate Javascript file. Modified Paths: -------------- trunk/lib/PageList.php Modified: trunk/lib/PageList.php =================================================================== --- trunk/lib/PageList.php 2009-03-27 09:23:18 UTC (rev 6723) +++ trunk/lib/PageList.php 2009-03-27 10:07:24 UTC (rev 6724) @@ -1423,12 +1423,6 @@ $table->pushContent(HTML::caption(array('align'=>'top'), $caption)); } - //Warning: This is quite fragile. It depends solely on a private variable - // in ->_addColumn() - if (!empty($this->_columns_seen['checkbox'])) { - $table->pushContent($this->_jsFlipAll()); - } - $row = HTML::tr(); $table_summary = array(); $i = 1; // start with 1! @@ -1470,21 +1464,6 @@ } } - function _jsFlipAll() { - return JavaScript(" -function flipAll(formObj) { - var isFirstSet = -1; - for (var i=0; i < formObj.length; i++) { - fldObj = formObj.elements[i]; - if ((fldObj.type == 'checkbox') && (fldObj.name.substring(0,2) == 'p[')) { - if (isFirstSet == -1) - isFirstSet = (fldObj.checked) ? true : false; - fldObj.checked = (isFirstSet) ? false : true; - } - } -}"); - } - /* recursive stack for private sublist options (azhead, cols) */ function _saveOptions($opts) { $stack = array('pages' => $this->_pages); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2009-04-03 09:44:14
|
Revision: 6766 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6766&view=rev Author: vargenau Date: 2009-04-03 09:43:54 +0000 (Fri, 03 Apr 2009) Log Message: ----------- If division does not give an integer, we need one more line Modified Paths: -------------- trunk/lib/PageList.php Modified: trunk/lib/PageList.php =================================================================== --- trunk/lib/PageList.php 2009-04-02 12:51:20 UTC (rev 6765) +++ trunk/lib/PageList.php 2009-04-03 09:43:54 UTC (rev 6766) @@ -1,4 +1,24 @@ -<?php rcs_id('$Id$'); +<?php +rcs_id('$Id$'); +/* Copyright (C) 2004-2008 $ThePhpWikiProgrammingTeam + * Copyright (C) 2008-2009 Marc-Etienne Vargenau, Alcatel-Lucent + * + * This file is part of PhpWiki. + * + * PhpWiki is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * PhpWiki is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with PhpWiki; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ /** * List a number of pagenames, optionally as table with various columns. @@ -1520,7 +1540,12 @@ // need a recursive switch here for the azhead and cols grouping. if (!empty($this->_options['cols']) and $this->_options['cols'] > 1) { $count = count($this->_pages); - $length = $count / $this->_options['cols']; + $length = intval($count / ($this->_options['cols'])); + // If division does not give an integer, we need one more line + // E.g. 13 pages to display in 3 columns. + if (($length * ($this->_options['cols'])) != $count) { + $length += 1; + } $width = sprintf("%d", 100 / $this->_options['cols']).'%'; $cols = HTML::tr(array('valign' => 'top')); for ($i=0; $i < $count; $i += $length) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ru...@us...> - 2009-04-16 06:51:39
|
Revision: 6778 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6778&view=rev Author: rurban Date: 2009-04-16 06:51:35 +0000 (Thu, 16 Apr 2009) Log Message: ----------- * ignore sortby clicked on init (debugging cruft) * fix assertion with sorting on multiple lists Modified Paths: -------------- trunk/lib/PageList.php Modified: trunk/lib/PageList.php =================================================================== --- trunk/lib/PageList.php 2009-04-09 16:18:22 UTC (rev 6777) +++ trunk/lib/PageList.php 2009-04-16 06:51:35 UTC (rev 6778) @@ -1,6 +1,6 @@ <?php rcs_id('$Id$'); -/* Copyright (C) 2004-2008 $ThePhpWikiProgrammingTeam +/* Copyright (C) 2004-2009 $ThePhpWikiProgrammingTeam * Copyright (C) 2008-2009 Marc-Etienne Vargenau, Alcatel-Lucent * * This file is part of PhpWiki. @@ -957,10 +957,11 @@ trigger_error("flip $order $column ".$this->id, E_USER_NOTICE); return ($order == '+' ? '-' : '+') . $column; } elseif ($action == 'init') { // only allowed from PageList::PageList - if ($this->sortby($column, 'clicked')) { - if (0 and DEBUG) + if (0 and DEBUG) { + if ($this->sortby($column, 'clicked')) { trigger_error("clicked $order $column $this->id", E_USER_NOTICE); //$order = ($order == '+' ? '-' : '+'); // $this->sortby($sortby, 'flip_order'); + } } $this->_sortby[$column] = $order; // forces show icon return $order . $column; @@ -1309,7 +1310,9 @@ elseif (isset($this->_types[$colNum])) $col = $this->_types[$colNum]; } - + if (empty($col)){ + return 0; + } assert(isset($col)); $revision_handle = false; $aval = $col->_getSortableValue($pagea, $revision_handle); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2009-06-03 14:46:02
|
Revision: 6851 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6851&view=rev Author: vargenau Date: 2009-06-03 14:46:00 +0000 (Wed, 03 Jun 2009) Log Message: ----------- New class PageList_Unselectable Modified Paths: -------------- trunk/lib/PageList.php Modified: trunk/lib/PageList.php =================================================================== --- trunk/lib/PageList.php 2009-06-03 14:35:30 UTC (rev 6850) +++ trunk/lib/PageList.php 2009-06-03 14:46:00 UTC (rev 6851) @@ -1725,6 +1725,31 @@ } } +class PageList_Unselectable +extends PageList { + + function PageList_Unselectable ($columns=false, $exclude='', $options = false) { + if ($columns) { + if (!is_array($columns)) + $columns = explode(',', $columns); + } else { + $columns = array('pagename'); + } + $this->PageList($columns, $exclude, $options); + } + + function addPageList ($array) { + while (list($pagename,$selected) = each($array)) { + if ($selected) $this->addPageSelected((string)$pagename); + $this->addPage((string)$pagename); + } + } + + function addPageSelected ($pagename) { + $this->_selected[$pagename] = 1; + } +} + // (c-file-style: "gnu") // Local Variables: // mode: php This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2009-06-04 14:51:35
|
Revision: 6895 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6895&view=rev Author: vargenau Date: 2009-06-04 14:51:28 +0000 (Thu, 04 Jun 2009) Log Message: ----------- Test correctly: string may be at start Modified Paths: -------------- trunk/lib/PageList.php Modified: trunk/lib/PageList.php =================================================================== --- trunk/lib/PageList.php 2009-06-04 13:42:06 UTC (rev 6894) +++ trunk/lib/PageList.php 2009-06-04 14:51:28 UTC (rev 6895) @@ -417,7 +417,7 @@ $score = $page_handle->score; elseif (!empty($page_handle['score'])) $score = $page_handle['score']; - if ($search and ($i = strpos(strtolower($c), strtolower($search)))) { + if ($search and ($i = strpos(strtolower($c), strtolower($search))) !== false) { $l = strlen($search); $j = max(0, $i - ($this->bytes / 2)); return HTML::div(array('style' => 'font-size:x-small'), @@ -426,7 +426,7 @@ HTML::span(array("style"=>"background:yellow"),substr($c, $i, $l)), HTML::span(substr($c, $i+$l, ($this->bytes / 2))."..."." ".($score ? sprintf("[%0.1f]",$score):"")))); } else { - if (strpos($c," ")) + if (strpos($c," ") !== false) $c = ""; else $c = sprintf(_("%s not found"), '»'.$search.'«'); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2009-06-06 10:07:28
|
Revision: 6903 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6903&view=rev Author: vargenau Date: 2009-06-06 10:07:24 +0000 (Sat, 06 Jun 2009) Log Message: ----------- Avoid "PHP Fatal error" in PHP5: test type Modified Paths: -------------- trunk/lib/PageList.php Modified: trunk/lib/PageList.php =================================================================== --- trunk/lib/PageList.php 2009-06-05 10:17:05 UTC (rev 6902) +++ trunk/lib/PageList.php 2009-06-06 10:07:24 UTC (rev 6903) @@ -413,9 +413,9 @@ } $search = $this->search; $score = ''; - if (!empty($page_handle->score)) + if (is_object($page_handle) and !empty($page_handle->score)) $score = $page_handle->score; - elseif (!empty($page_handle['score'])) + elseif (is_array($page_handle) and !empty($page_handle['score'])) $score = $page_handle['score']; if ($search and ($i = strpos(strtolower($c), strtolower($search))) !== false) { $l = strlen($search); @@ -448,9 +448,9 @@ ByteFormatter($len, /*$longformat = */true)); } function _getSortableValue ($page_handle, &$revision_handle) { - if (!empty($page_handle->score)) + if (is_object($page_handle) and !empty($page_handle->score)) return $page_handle->score; - elseif (!empty($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); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2009-06-09 08:30:42
|
Revision: 6907 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6907&view=rev Author: vargenau Date: 2009-06-09 08:30:38 +0000 (Tue, 09 Jun 2009) Log Message: ----------- Do not display dots if string is at beginning Modified Paths: -------------- trunk/lib/PageList.php Modified: trunk/lib/PageList.php =================================================================== --- trunk/lib/PageList.php 2009-06-07 07:11:43 UTC (rev 6906) +++ trunk/lib/PageList.php 2009-06-09 08:30:38 UTC (rev 6907) @@ -422,7 +422,7 @@ $j = max(0, $i - ($this->bytes / 2)); return HTML::div(array('style' => 'font-size:x-small'), HTML::div(array('class' => 'transclusion'), - HTML::span("...".substr($c, $j, ($this->bytes / 2))), + HTML::span(($j ? '...' : '').substr($c, $j, ($j ? $this->bytes / 2 : $i))), HTML::span(array("style"=>"background:yellow"),substr($c, $i, $l)), HTML::span(substr($c, $i+$l, ($this->bytes / 2))."..."." ".($score ? sprintf("[%0.1f]",$score):"")))); } else { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2009-06-10 14:17:28
|
Revision: 6910 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6910&view=rev Author: vargenau Date: 2009-06-10 13:38:40 +0000 (Wed, 10 Jun 2009) Log Message: ----------- Add "external" column Modified Paths: -------------- trunk/lib/PageList.php Modified: trunk/lib/PageList.php =================================================================== --- trunk/lib/PageList.php 2009-06-10 12:51:48 UTC (rev 6909) +++ trunk/lib/PageList.php 2009-06-10 13:38:40 UTC (rev 6910) @@ -700,6 +700,7 @@ 'size' => null, 'version' => null, 'markup' => null, + 'external' => null, ); } @@ -1183,6 +1184,9 @@ 'locked' => new _PageList_Column_bool('locked', _("Locked"), _("locked")), + 'external' + => new _PageList_Column_bool('external', _("External"), + _("external")), 'minor' => new _PageList_Column_bool('rev:is_minor_edit', _("Minor Edit"), _("minor")), This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2009-06-10 14:22:29
|
Revision: 6911 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6911&view=rev Author: vargenau Date: 2009-06-10 13:42:56 +0000 (Wed, 10 Jun 2009) Log Message: ----------- UserPages: replace "created" by "owned" (more flexible) Modified Paths: -------------- trunk/lib/PageList.php Modified: trunk/lib/PageList.php =================================================================== --- trunk/lib/PageList.php 2009-06-10 13:38:40 UTC (rev 6910) +++ trunk/lib/PageList.php 2009-06-10 13:42:56 UTC (rev 6911) @@ -1112,7 +1112,7 @@ return $allPages; } - // UserPages are pages NOT created by ADMIN_USER + // UserPages are pages NOT owned by ADMIN_USER function allUserPages($include_empty=false, $sortby='', $limit='', $exclude='') { $dbi = $GLOBALS['request']->getDbh(); @@ -1120,8 +1120,8 @@ $allPages = array(); while ($pagehandle = $allPagehandles->next()) { $name = $pagehandle->getName(); - $creator = $pagehandle->getCreator(); - if ($creator !== ADMIN_USER) { + $owner = $pagehandle->getOwner(); + if ($owner !== ADMIN_USER) { $allPages[] = $name; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2009-06-11 09:30:12
|
Revision: 6914 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6914&view=rev Author: vargenau Date: 2009-06-11 09:30:10 +0000 (Thu, 11 Jun 2009) Log Message: ----------- One image is enough Modified Paths: -------------- trunk/lib/PageList.php Modified: trunk/lib/PageList.php =================================================================== --- trunk/lib/PageList.php 2009-06-10 14:31:52 UTC (rev 6913) +++ trunk/lib/PageList.php 2009-06-11 09:30:10 UTC (rev 6914) @@ -174,7 +174,6 @@ 'id' => $pagelist->id)), 'class' => 'gridbutton', 'title' => sprintf(_("Click to sort by %s"), $reverse . $this->_field)), - $nbsp, $noimg, $nbsp, $this->_heading, $nbsp, $img, $nbsp); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2009-06-15 18:50:57
|
Revision: 6934 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6934&view=rev Author: vargenau Date: 2009-06-15 12:45:34 +0000 (Mon, 15 Jun 2009) Log Message: ----------- Let us trim page names (user might have put spaces in watch pages preferences) Modified Paths: -------------- trunk/lib/PageList.php Modified: trunk/lib/PageList.php =================================================================== --- trunk/lib/PageList.php 2009-06-15 10:49:07 UTC (rev 6933) +++ trunk/lib/PageList.php 2009-06-15 12:45:34 UTC (rev 6934) @@ -1015,7 +1015,7 @@ $iter = $dbi->titleSearch($search, $sortby, $limit, $exclude); $pages = array(); while ($pagehandle = $iter->next()) { - $pages[] = $pagehandle->getName(); + $pages[] = trim($pagehandle->getName()); } return $pages; /* @@ -1029,7 +1029,7 @@ */ } else { //TODO: do the sorting, normally not needed if used for exclude only - return explode(',', $input); + return array_map("trim", explode(',', $input)); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2009-06-23 17:58:16
|
Revision: 6954 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6954&view=rev Author: vargenau Date: 2009-06-23 17:58:15 +0000 (Tue, 23 Jun 2009) Log Message: ----------- Remove special characters so that highligting works Modified Paths: -------------- trunk/lib/PageList.php Modified: trunk/lib/PageList.php =================================================================== --- trunk/lib/PageList.php 2009-06-23 17:55:57 UTC (rev 6953) +++ trunk/lib/PageList.php 2009-06-23 17:58:15 UTC (rev 6954) @@ -416,6 +416,8 @@ $score = $page_handle->score; elseif (is_array($page_handle) and !empty($page_handle['score'])) $score = $page_handle['score']; + $search = preg_replace('/^[\^\*]/', '', $search); + $search = preg_replace('/[\^\*]$/', '', $search); if ($search and ($i = strpos(strtolower($c), strtolower($search))) !== false) { $l = strlen($search); $j = max(0, $i - ($this->bytes / 2)); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2009-06-24 08:05:12
|
Revision: 6955 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6955&view=rev Author: vargenau Date: 2009-06-24 08:04:35 +0000 (Wed, 24 Jun 2009) Log Message: ----------- Add comment about highlighting Modified Paths: -------------- trunk/lib/PageList.php Modified: trunk/lib/PageList.php =================================================================== --- trunk/lib/PageList.php 2009-06-23 17:58:15 UTC (rev 6954) +++ trunk/lib/PageList.php 2009-06-24 08:04:35 UTC (rev 6955) @@ -416,6 +416,7 @@ $score = $page_handle->score; elseif (is_array($page_handle) and !empty($page_handle['score'])) $score = $page_handle['score']; + // Remove special characters so that highlighting works $search = preg_replace('/^[\^\*]/', '', $search); $search = preg_replace('/[\^\*]$/', '', $search); if ($search and ($i = strpos(strtolower($c), strtolower($search))) !== false) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ru...@us...> - 2009-08-31 11:21:15
|
Revision: 7093 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7093&view=rev Author: rurban Date: 2009-08-31 11:21:07 +0000 (Mon, 31 Aug 2009) Log Message: ----------- fix wrong paging with cols. ol start value (listtype=ol) not yet stable Modified Paths: -------------- trunk/lib/PageList.php Modified: trunk/lib/PageList.php =================================================================== --- trunk/lib/PageList.php 2009-08-31 10:58:59 UTC (rev 7092) +++ trunk/lib/PageList.php 2009-08-31 11:21:07 UTC (rev 7093) @@ -1527,15 +1527,15 @@ if (empty($this->_pages)) return; // stop recursion if (!isset($this->_options['listtype'])) $this->_options['listtype'] = ''; - $nb_row = 0; - foreach ($this->_pages as $pagenum => $page) { - $one_row = $this->_renderPageRow($page); + $nb_row = 0; + foreach ($this->_pages as $pagenum => $page) { + $one_row = $this->_renderPageRow($page); $rows[] = array('header' => WikiLink($page), 'render' => $one_row); if ($one_row) $nb_row++; - } + } $out = HTML(); if ($caption) { - $caption = preg_replace('/{total}/', $nb_row, asString($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 @@ -1558,9 +1558,13 @@ } } + if (!empty($this->_options['limit'])) + list($offset, $count) = $this->limit($this->_options['limit']); + else { + $offset = 0; $count = count($this->_pages); + } // need a recursive switch here for the azhead and cols grouping. if (!empty($this->_options['cols']) and $this->_options['cols'] > 1) { - $count = count($this->_pages); $length = intval($count / ($this->_options['cols'])); // If division does not give an integer, we need one more line // E.g. 13 pages to display in 3 columns. @@ -1569,7 +1573,7 @@ } $width = sprintf("%d", 100 / $this->_options['cols']).'%'; $cols = HTML::tr(array('valign' => 'top')); - for ($i=0; $i < $count; $i += $length) { + 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),*/ @@ -1577,9 +1581,10 @@ $this->_restoreOptions(); } // speed up table rendering by defining colgroups - $out->pushContent(HTML::table(HTML::colgroup(array('span' => $this->_options['cols'], - 'width' => $width)), - $cols)); + $out->pushContent(HTML::table(HTML::colgroup + (array('span' => $this->_options['cols'], + 'width' => $width)), + $cols)); return $out; } @@ -1596,7 +1601,7 @@ $page =& $this->_pages[$i]; $h = substr($page->getName(), 0, 1); if ($h != $cur_h and $i > $j) { - $this->_saveOptions(array('cols' => 0, 'azhead' => 0)); + $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(); @@ -1606,7 +1611,7 @@ } } if ($i > $j) { // flush the rest - $this->_saveOptions(array('cols' => 0, 'azhead' => 0)); + $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(); @@ -1624,13 +1629,16 @@ return $out; } - if ($this->_options['listtype'] == 'ol') - $this->_options['ordered'] = 1; - elseif ($this->_options['listtype'] == 'ul') + if ($this->_options['listtype'] == 'ol') { + if (empty($this->_options['ordered'])) { + $this->_options['ordered'] = $offset+1; + } + } elseif ($this->_options['listtype'] == 'ul') $this->_options['ordered'] = 0; - if (!empty($this->_options['ordered'])) - $list = HTML::ol(array('class' => 'pagelist')); - elseif ($this->_options['listtype'] == 'dl') { + if ($this->_options['listtype'] == 'ol' and !empty($this->_options['ordered'])) { + $list = HTML::ol(array('class' => 'pagelist', + 'start' => $this->_options['ordered'])); + } elseif ($this->_options['listtype'] == 'dl') { $list = HTML::dl(array('class' => 'pagelist')); } else { $list = HTML::ul(array('class' => 'pagelist')); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2009-11-05 19:08:32
|
Revision: 7260 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7260&view=rev Author: vargenau Date: 2009-11-05 19:08:17 +0000 (Thu, 05 Nov 2009) Log Message: ----------- Valid XHTML code Modified Paths: -------------- trunk/lib/PageList.php Modified: trunk/lib/PageList.php =================================================================== --- trunk/lib/PageList.php 2009-11-05 14:34:03 UTC (rev 7259) +++ trunk/lib/PageList.php 2009-11-05 19:08:17 UTC (rev 7260) @@ -424,8 +424,7 @@ $html = array(); foreach (array_slice($matches,0,5) as $line) { $line = WikiPlugin_FullTextSearch::highlight_line($line, $hilight_re); - $html[] = HTML::dd(HTML::small(array('class' => 'search-context'), - $line)); + $html[] = HTML::p(HTML::small(array('class' => 'search-context'), $line)); } if ($score) $html[] = sprintf("... [%0.1f]",$score); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ru...@us...> - 2009-11-12 08:48:06
|
Revision: 7267 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7267&view=rev Author: rurban Date: 2009-11-12 08:47:58 +0000 (Thu, 12 Nov 2009) Log Message: ----------- reenable HTML caption: quoting Modified Paths: -------------- trunk/lib/PageList.php Modified: trunk/lib/PageList.php =================================================================== --- trunk/lib/PageList.php 2009-11-10 15:13:07 UTC (rev 7266) +++ trunk/lib/PageList.php 2009-11-12 08:47:58 UTC (rev 7267) @@ -427,10 +427,8 @@ $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 @@ 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', )); 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 @@ } $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 @@ function _emptyList($caption) { $html = HTML(); if ($caption) { + if (is_string($caption)) $caption = preg_replace('/{total}/', '0', asString($caption)); $html->pushContent(HTML::p($caption)); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2010-04-15 10:01:51
|
Revision: 7333 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7333&view=rev Author: vargenau Date: 2010-04-15 10:01:45 +0000 (Thu, 15 Apr 2010) Log Message: ----------- Use big value since paging does not work Modified Paths: -------------- trunk/lib/PageList.php Modified: trunk/lib/PageList.php =================================================================== --- trunk/lib/PageList.php 2010-04-15 09:27:52 UTC (rev 7332) +++ trunk/lib/PageList.php 2010-04-15 10:01:45 UTC (rev 7333) @@ -692,7 +692,9 @@ * These options may also be given to _generate(List|Table) later * But limit and offset might help the query WikiDB::getAllPages() */ - 'limit' => 50, // number of rows (pagesize) + // Use big value since paging does not work. + // 'limit' => 50, // number of rows (pagesize) + 'limit' => 5000, // number of rows (pagesize) 'paging' => 'auto', // 'auto' top + bottom rows if applicable // // 'top' top only if applicable // // 'bottom' bottom only if applicable This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ru...@us...> - 2010-06-09 12:09:53
|
Revision: 7511 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7511&view=rev Author: rurban Date: 2010-06-09 12:09:47 +0000 (Wed, 09 Jun 2010) Log Message: ----------- update (c) and doc Modified Paths: -------------- trunk/lib/PageList.php Modified: trunk/lib/PageList.php =================================================================== --- trunk/lib/PageList.php 2010-06-09 12:08:08 UTC (rev 7510) +++ trunk/lib/PageList.php 2010-06-09 12:09:47 UTC (rev 7511) @@ -1,6 +1,6 @@ <?php //rcs_id('$Id$'); -/* Copyright (C) 2004-2009 $ThePhpWikiProgrammingTeam +/* Copyright (C) 2004-2010 $ThePhpWikiProgrammingTeam * Copyright (C) 2008-2009 Marc-Etienne Vargenau, Alcatel-Lucent * * This file is part of PhpWiki. @@ -71,7 +71,9 @@ * all columns are sortable. Thanks to the wikilens team. * cols > 1, comma, azhead, ordered (OL lists) * ->supportedArgs() which arguments are supported, so that the plugin - * doesn't explictly need to declare it + * doesn't explictly need to declare it + * added slice option when the page_iter (e.g. ->_pages) is already sliced. + * * TODO: * fix sortby logic, fix multiple sortby and other paging args per page. * info=relation,linkto nopage=1 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ru...@us...> - 2010-06-23 13:39:27
|
Revision: 7558 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7558&view=rev Author: rurban Date: 2010-06-23 13:39:18 +0000 (Wed, 23 Jun 2010) Log Message: ----------- protect from slice warnings Modified Paths: -------------- trunk/lib/PageList.php Modified: trunk/lib/PageList.php =================================================================== --- trunk/lib/PageList.php 2010-06-23 13:13:40 UTC (rev 7557) +++ trunk/lib/PageList.php 2010-06-23 13:39:18 UTC (rev 7558) @@ -1605,9 +1605,9 @@ } } - if (!empty($this->_options['limit']) and $this->_options['slice']) + if (!empty($this->_options['limit']) and !empty($this->_options['slice'])) { list($offset, $count) = $this->limit($this->_options['limit']); - else { + } else { $offset = 0; $count = count($this->_pages); } // need a recursive switch here for the azhead and cols grouping. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2010-06-23 14:27:00
|
Revision: 7559 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7559&view=rev Author: vargenau Date: 2010-06-23 14:26:54 +0000 (Wed, 23 Jun 2010) Log Message: ----------- In Gforge, anon users can see ratings but cannot rate Modified Paths: -------------- trunk/lib/PageList.php Modified: trunk/lib/PageList.php =================================================================== --- trunk/lib/PageList.php 2010-06-23 13:39:18 UTC (rev 7558) +++ trunk/lib/PageList.php 2010-06-23 14:26:54 UTC (rev 7559) @@ -1,7 +1,7 @@ <?php //rcs_id('$Id$'); /* Copyright (C) 2004-2010 $ThePhpWikiProgrammingTeam - * Copyright (C) 2008-2009 Marc-Etienne Vargenau, Alcatel-Lucent + * Copyright (C) 2008-2010 Marc-Etienne Vargenau, Alcatel-Lucent * * This file is part of PhpWiki. * @@ -1302,10 +1302,13 @@ trigger_error(sprintf("%s: Bad column", $column), E_USER_NOTICE); return false; } - // FIXME: anon users might rate and see ratings also. - // Defer this logic to the plugin. - if ($column == 'rating' and !$GLOBALS['request']->_user->isSignedIn()) - return false; + if (!GFORGE) { + // FIXME: anon users might rate and see ratings also. + // Defer this logic to the plugin. + if ($column == 'rating' and !$GLOBALS['request']->_user->isSignedIn()) { + return false; + } + } $this->addColumnObject($this->_types[$column]); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |