SourceForge logo
SourceForge logo
Menu

phpwiki-checkins

Revision: 6244
 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6244&view=rev
Author: vargenau
Date: 2008年09月07日 11:17:06 +0000 (2008年9月07日)
Log Message:
-----------
Removed history
Modified Paths:
--------------
 trunk/lib/plugin/WikiAdminRename.php
Modified: trunk/lib/plugin/WikiAdminRename.php
===================================================================
--- trunk/lib/plugin/WikiAdminRename.php	2008年09月07日 11:15:18 UTC (rev 6243)
+++ trunk/lib/plugin/WikiAdminRename.php	2008年09月07日 11:17:06 UTC (rev 6244)
@@ -256,146 +256,6 @@
 }
 };
 
-// $Log: not supported by cvs2svn $
-// Revision 1.29 2008年04月14日 17:49:50 vargenau
-// Generate valid XHTML code
-//
-// Revision 1.28 2007年09月15日 12:30:24 rurban
-// temp. disable support for Change pagename in all linked pages also. This is broken.
-//
-// Revision 1.27 2007年08月25日 18:08:24 rurban
-// change rename action from access perm change to edit: allow the signed in user to rename. Improve layout
-//
-// Revision 1.26 2005年04月01日 16:06:41 rurban
-// do not trim spaces
-//
-// Revision 1.25 2005年04月01日 15:22:20 rurban
-// Implement icase and regex options.
-// Change checkbox case message from "Case-Sensitive" to "Case-Insensitive"
-//
-// Revision 1.24 2005年04月01日 15:03:01 rurban
-// Optimize rename UI with one selected pagename
-//
-// Revision 1.23 2005年02月12日 17:24:24 rurban
-// locale update: missing . : fixed. unified strings
-// proper linebreaks
-//
-// Revision 1.22 2004年11月23日 15:17:20 rurban
-// better support for case_exact search (not caseexact for consistency),
-// plugin args simplification:
-// handle and explode exclude and pages argument in WikiPlugin::getArgs
-// and exclude in advance (at the sql level if possible)
-// handle sortby and limit from request override in WikiPlugin::getArgs
-// ListSubpages: renamed pages to maxpages
-//
-// Revision 1.21 2004年11月01日 10:43:59 rurban
-// seperate PassUser methods into seperate dir (memory usage)
-// fix WikiUser (old) overlarge data session
-// remove wikidb arg from various page class methods, use global ->_dbi instead
-// ...
-//
-// Revision 1.20 2004年06月16日 10:38:59 rurban
-// Disallow refernces in calls if the declaration is a reference
-// ("allow_call_time_pass_reference clean").
-// PhpWiki is now allow_call_time_pass_reference = Off clean,
-// but several external libraries may not.
-// In detail these libs look to be affected (not tested):
-// * Pear_DB odbc
-// * adodb oracle
-//
-// Revision 1.19 2004年06月14日 11:31:39 rurban
-// renamed global $Theme to $WikiTheme (gforge nameclash)
-// inherit PageList default options from PageList
-// default sortby=pagename
-// use options in PageList_Selectable (limit, sortby, ...)
-// added action revert, with button at action=diff
-// added option regex to WikiAdminSearchReplace
-//
-// Revision 1.18 2004年06月13日 15:33:20 rurban
-// new support for arguments owner, author, creator in most relevant
-// PageList plugins. in WikiAdmin* via preSelectS()
-//
-// Revision 1.17 2004年06月08日 10:05:12 rurban
-// simplified admin action shortcuts
-//
-// Revision 1.16 2004年06月07日 18:57:31 rurban
-// fix rename: Change pagename in all linked pages
-//
-// Revision 1.15 2004年06月04日 20:32:54 rurban
-// Several locale related improvements suggested by Pierrick Meignen
-// LDAP fix by John Cole
-// reanable admin check without ENABLE_PAGEPERM in the admin plugins
-//
-// Revision 1.14 2004年06月03日 22:24:48 rurban
-// reenable admin check on !ENABLE_PAGEPERM, honor s=Wildcard arg, fix warning after Remove
-//
-// Revision 1.13 2004年06月03日 12:59:41 rurban
-// simplify translation
-// NS4 wrap=virtual only
-//
-// Revision 1.12 2004年06月01日 15:28:01 rurban
-// AdminUser only ADMIN_USER not member of Administrators
-// some RateIt improvements by dfrankow
-// edit_toolbar buttons
-//
-// Revision 1.11 2004年05月24日 17:34:53 rurban
-// use ACLs
-//
-// Revision 1.10 2004年04月06日 20:00:11 rurban
-// Cleanup of special PageList column types
-// Added support of plugin and theme specific Pagelist Types
-// Added support for theme specific UserPreferences
-// Added session support for ip-based throttling
-// sql table schema change: ALTER TABLE session ADD sess_ip CHAR(15);
-// Enhanced postgres schema
-// Added DB_Session_dba support
-//
-// Revision 1.9 2004年03月12日 13:31:43 rurban
-// enforce PagePermissions, errormsg if not Admin
-//
-// Revision 1.8 2004年03月01日 13:48:46 rurban
-// rename fix
-// p[] consistency fix
-//
-// Revision 1.7 2004年02月22日 23:20:33 rurban
-// fixed DumpHtmlToDir,
-// enhanced sortby handling in PageList
-// new button_heading th style (enabled),
-// added sortby and limit support to the db backends and plugins
-// for paging support (<<prev, next>> links on long lists)
-//
-// Revision 1.6 2004年02月17日 12:11:36 rurban
-// added missing 4th basepage arg at plugin->run() to almost all plugins. This caused no harm so far, because it was silently dropped on normal usage. However on plugin internal ->run invocations it failed. (InterWikiSearch, IncludeSiteMap, ...)
-//
-// Revision 1.5 2004年02月15日 21:34:37 rurban
-// PageList enhanced and improved.
-// fixed new WikiAdmin... plugins
-// editpage, Theme with exp. htmlarea framework
-// (htmlarea yet committed, this is really questionable)
-// WikiUser... code with better session handling for prefs
-// enhanced UserPreferences (again)
-// RecentChanges for show_deleted: how should pages be deleted then?
-//
-// Revision 1.4 2004年02月12日 17:05:39 rurban
-// WikiAdminRename:
-// added "Change pagename in all linked pages also"
-// PageList:
-// added javascript toggle for Select
-// WikiAdminSearchReplace:
-// fixed another typo
-//
-// Revision 1.3 2004年02月12日 13:05:50 rurban
-// Rename functional for PearDB backend
-// some other minor changes
-// SiteMap comes with a not yet functional feature request: includepages (tbd)
-//
-// Revision 1.2 2004年02月12日 11:45:11 rurban
-// only WikiDB method missing
-//
-// Revision 1.1 2004年02月11日 20:00:16 rurban
-// WikiAdmin... series overhaul. Rename misses the db backend methods yet. Chmod + Chwon still missing.
-//
-
 // Local Variables:
 // mode: php
 // tab-width: 8
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 6301
 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6301&view=rev
Author: vargenau
Date: 2008年10月14日 16:12:00 +0000 (2008年10月14日)
Log Message:
-----------
It's not an error; all pages are displayed in PhpWikiAdministration/Rename
Modified Paths:
--------------
 trunk/lib/plugin/WikiAdminRename.php
Modified: trunk/lib/plugin/WikiAdminRename.php
===================================================================
--- trunk/lib/plugin/WikiAdminRename.php	2008年10月14日 16:01:39 UTC (rev 6300)
+++ trunk/lib/plugin/WikiAdminRename.php	2008年10月14日 16:12:00 UTC (rev 6301)
@@ -249,10 +249,6 @@
 'name' => 'rename[]',
 'value' => $value)));
 $new_page = $request->getPage($value);
- if ($new_page->exists()) {
- $div->setAttr('class','error');
- $div->setAttr('title',_("This page already exists"));
- }
 return $div;
 }
 };
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 6492
 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6492&view=rev
Author: vargenau
Date: 2009年02月13日 10:18:44 +0000 (2009年2月13日)
Log Message:
-----------
Page renaming now recordered in history
Modified Paths:
--------------
 trunk/lib/plugin/WikiAdminRename.php
Modified: trunk/lib/plugin/WikiAdminRename.php
===================================================================
--- trunk/lib/plugin/WikiAdminRename.php	2009年02月13日 09:58:46 UTC (rev 6491)
+++ trunk/lib/plugin/WikiAdminRename.php	2009年02月13日 10:18:44 UTC (rev 6492)
@@ -2,7 +2,7 @@
 rcs_id('$Id$');
 /*
 Copyright 2004,2005,2007 $ThePhpWikiProgrammingTeam
- Copyright 2008 Marc-Etienne Vargenau, Alcatel-Lucent
+ Copyright 2008-2009 Marc-Etienne Vargenau, Alcatel-Lucent
 
 This file is part of PhpWiki.
 
@@ -86,6 +86,13 @@
 WikiLink($name))));
 elseif ( $dbi->renamePage($name, $newname, $updatelinks)) {
 /* not yet implemented for all backends */
+ $page = $dbi->getPage($newname);
+ $current = $page->getCurrentRevision();
+ $version = $current->getVersion();
+ $meta = $current->_data;
+ $text = $current->getPackedContent();
+ $meta['summary'] = sprintf(_("Renamed page from '%s' to '%s'"), $name, $newname);
+ $page->save($text, $version + 1, $meta);
 $ul->pushContent(HTML::li(fmt("Renamed page '%s' to '%s'.",
 $name, WikiLink($newname))));
 $count++;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 6493
 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6493&view=rev
Author: vargenau
Date: 2009年02月13日 16:15:15 +0000 (2009年2月13日)
Log Message:
-----------
Set author and modification time
Modified Paths:
--------------
 trunk/lib/plugin/WikiAdminRename.php
Modified: trunk/lib/plugin/WikiAdminRename.php
===================================================================
--- trunk/lib/plugin/WikiAdminRename.php	2009年02月13日 10:18:44 UTC (rev 6492)
+++ trunk/lib/plugin/WikiAdminRename.php	2009年02月13日 16:15:15 UTC (rev 6493)
@@ -92,6 +92,9 @@
 $meta = $current->_data;
 $text = $current->getPackedContent();
 $meta['summary'] = sprintf(_("Renamed page from '%s' to '%s'"), $name, $newname);
+ $meta['is_minor_edit'] = 0;
+ $meta['author'] = $request->_user->UserName();
+ unset($meta['mtime']); // force new date
 $page->save($text, $version + 1, $meta);
 $ul->pushContent(HTML::li(fmt("Renamed page '%s' to '%s'.",
 $name, WikiLink($newname))));
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 6785
 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6785&view=rev
Author: vargenau
Date: 2009年04月18日 16:28:49 +0000 (2009年4月18日)
Log Message:
-----------
1) New option: checkbox to allow automatic creation of redirect page from old name to new name.
2) Simpler user interface when renaming a single page (from Rename tab).
3) Use CSS classes "feedback" and "error".
Modified Paths:
--------------
 trunk/lib/plugin/WikiAdminRename.php
Modified: trunk/lib/plugin/WikiAdminRename.php
===================================================================
--- trunk/lib/plugin/WikiAdminRename.php	2009年04月18日 16:21:55 UTC (rev 6784)
+++ trunk/lib/plugin/WikiAdminRename.php	2009年04月18日 16:28:49 UTC (rev 6785)
@@ -55,7 +55,8 @@
 		 's' 	=> false,
 		 /* Columns to include in listing */
 		 'info' => 'pagename,mtime',
-		 'updatelinks' => 0
+		 'updatelinks' => 0,
+		 'createredirect' => 0
 		 ));
 }
 
@@ -68,7 +69,8 @@
 return str_replace($from, $to, $name);
 }
 
- function renamePages(&$dbi, &$request, $pages, $from, $to, $updatelinks=false) {
+ function renamePages(&$dbi, &$request, $pages, $from, $to, $updatelinks=false, $createredirect=false) {
+ $result = HTML::div();
 $ul = HTML::ul();
 $count = 0;
 $post_args = $request->getArg('admin_rename');
@@ -93,9 +95,17 @@
 $text = $current->getPackedContent();
 $meta['summary'] = sprintf(_("Renamed page from '%s' to '%s'"), $name, $newname);
 $meta['is_minor_edit'] = 0;
- $meta['author'] = $request->_user->UserName();
+ $meta['author'] = $request->_user->UserName();
 unset($meta['mtime']); // force new date
 $page->save($text, $version + 1, $meta);
+ if ($createredirect) {
+ $page = $dbi->getPage($name);
+ $text = "<<RedirectTo page=\"" . $newname . "\">>";
+ $meta['summary'] = sprintf(_("Renaming created redirect page from '%s' to '%s'"), $name, $newname);
+ $meta['is_minor_edit'] = 0;
+ $meta['author'] = $request->_user->UserName();
+ $page->save($text, 1, $meta);
+ }
 $ul->pushContent(HTML::li(fmt("Renamed page '%s' to '%s'.",
 $name, WikiLink($newname))));
 $count++;
@@ -110,10 +120,15 @@
 }
 if ($count) {
 $dbi->touch();
- return HTML($ul, HTML::p(fmt("%s pages have been permanently renamed.",
- $count)));
+ $result->setAttr('class', 'feedback');
+ $result->pushContent(HTML::p(fmt("%s pages have been permanently renamed:", $count)));
+ $result->pushContent($ul);
+ return $result;
 } else {
- return HTML($ul, HTML::p(fmt("No pages renamed.")));
+ $result->setAttr('class', 'error');
+ $result->pushContent(HTML::p(fmt("No pages renamed:")));
+ $result->pushContent($ul);
+ return $result;
 }
 }
 
@@ -122,7 +137,16 @@
 if ($action != 'browse' and $action != 'rename' 
 and $action != _("PhpWikiAdministration")."/"._("Rename"))
 return $this->disabled("(action != 'browse')");
- 
+
+ if ($action == 'rename') {
+ // We rename a single page.
+ // No need to display "Regex?" and "Case insensitive?" boxes
+ // No need to confirm
+ $singlepage = true;
+ } else {
+ $singlepage = false;
+ }
+
 $args = $this->getArgs($argstr, $request);
 $this->_args = $args;
 $this->preSelectS($args, $request);
@@ -146,7 +170,8 @@
 // Real action
 return $this->renamePages($dbi, $request, array_keys($p), 
 $post_args['from'], $post_args['to'], 
- !empty($post_args['updatelinks']));
+ !empty($post_args['updatelinks']),
+ !empty($post_args['createredirect']));
 }
 if ($post_args['action'] == 'select') {
 if (!empty($post_args['from']))
@@ -178,27 +203,37 @@
 $header->pushContent(
 HTML::p(HTML::strong(
 _("Are you sure you want to permanently rename the selected pages?"))));
- $header = $this->renameForm($header, $post_args);
- }
- else {
- $button_label = _("Rename selected pages");
+ $header = $this->renameForm($header, $post_args, $singlepage);
+ } else {
+ if ($singlepage === true) {
+ $button_label = _("Rename page");
+ } else {
+ $button_label = _("Rename selected pages");
+ }
 if (!$post_args and count($pages) == 1) {
 list($post_args['from'],) = array_keys($pages);
 $post_args['to'] = $post_args['from'];
 }
- $header = $this->renameForm($header, $post_args);
- $header->pushContent(HTML::p(_("Select the pages to rename:")));
+ $header = $this->renameForm($header, $post_args, $singlepage);
+ if ($singlepage === false) {
+ $header->pushContent(HTML::p(_("Select the pages to rename:")));
+ }
 }
 
 $buttons = HTML::p(Button('submit:admin_rename[rename]', $button_label, 'wikiadmin'),
 			 HTML::Raw('&nbsp;&nbsp;'),
 Button('submit:admin_rename[cancel]', _("Cancel"), 'button'));
 
+ if ($singlepage === false) {
+ $list = $pagelist->getContent();
+ } else {
+ $list = ""; 
+ }
 return HTML::form(array('action' => $request->getPostURL(),
 'method' => 'post'),
 $header,
 $buttons,
- $pagelist->getContent(),
+ $list,
 HiddenInputs($request->getArgs(),
 false,
 array('admin_rename')),
@@ -219,7 +254,7 @@
 return HTML::div($checkbox, ' ', HTML::label(array('for' => $id), $msg));
 }
 
- function renameForm(&$header, $post_args) {
+ function renameForm(&$header, $post_args, $singlepage) {
 $table = HTML::table();
 $this->_tablePush($table, _("Rename"). " ". _("from").': ',
 			 HTML::input(array('name' => 'admin_rename[from]',
@@ -229,11 +264,15 @@
 			 HTML::input(array('name' => 'admin_rename[to]',
 					 'size' => 90,
 					 'value' => $post_args['to'])));
-	$this->_tablePush($table, '', $this->checkBox($post_args, 'regex', _("Regex?")));
- $this->_tablePush($table, '', $this->checkBox($post_args, 'icase', _("Case insensitive?")));
+ if ($singlepage === false) {
+	 $this->_tablePush($table, '', $this->checkBox($post_args, 'regex', _("Regex?")));
+ $this->_tablePush($table, '', $this->checkBox($post_args, 'icase', _("Case insensitive?")));
+ }
 	if (DEBUG) // not yet stable
 	 $this->_tablePush($table, '', $this->checkBox($post_args, 'updatelinks', 
 						 _("Change pagename in all linked pages also?")));
+	$this->_tablePush($table, '', $this->checkBox($post_args, 'createredirect', 
+						 _("Create redirect from old to new name?")));
 $header->pushContent($table);
 return $header;
 }
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 6795
 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6795&view=rev
Author: vargenau
Date: 2009年04月19日 09:59:32 +0000 (2009年4月19日)
Log Message:
-----------
Add fieldset
Modified Paths:
--------------
 trunk/lib/plugin/WikiAdminRename.php
Modified: trunk/lib/plugin/WikiAdminRename.php
===================================================================
--- trunk/lib/plugin/WikiAdminRename.php	2009年04月18日 17:12:28 UTC (rev 6794)
+++ trunk/lib/plugin/WikiAdminRename.php	2009年04月19日 09:59:32 UTC (rev 6795)
@@ -231,16 +231,18 @@
 }
 return HTML::form(array('action' => $request->getPostURL(),
 'method' => 'post'),
- $header,
- $buttons,
- $list,
- HiddenInputs($request->getArgs(),
- false,
- array('admin_rename')),
- HiddenInputs(array('admin_rename[action]' => $next_action)),
- ENABLE_PAGEPERM
- ? ''
- : HiddenInputs(array('require_authority_for_post' => WIKIAUTH_ADMIN)));
+ HTML::fieldset(
+ HTML::legend("Rename page"),
+ $header,
+ $buttons,
+ $list,
+ HiddenInputs($request->getArgs(),
+ false,
+ array('admin_rename')),
+ HiddenInputs(array('admin_rename[action]' => $next_action)),
+ ENABLE_PAGEPERM
+ ? ''
+ : HiddenInputs(array('require_authority_for_post' => WIKIAUTH_ADMIN))));
 }
 
 function checkBox (&$post_args, $name, $msg) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 7136
 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7136&view=rev
Author: rurban
Date: 2009年09月17日 08:40:19 +0000 (2009年9月17日)
Log Message:
-----------
* break overlong lines
* skip handled errors
* let the WikiDB + backend do the database changes
Modified Paths:
--------------
 trunk/lib/plugin/WikiAdminRename.php
Modified: trunk/lib/plugin/WikiAdminRename.php
===================================================================
--- trunk/lib/plugin/WikiAdminRename.php	2009年09月16日 14:58:48 UTC (rev 7135)
+++ trunk/lib/plugin/WikiAdminRename.php	2009年09月17日 08:40:19 UTC (rev 7136)
@@ -26,7 +26,7 @@
 * @author: Reini Urban <ru...@x-...>
 *
 * KNOWN ISSUES:
- * Requires PHP 4.2.
+ * Requires PHP 4.2 at least.
 */
 require_once('lib/PageList.php');
 require_once('lib/plugin/WikiAdminSelect.php');
@@ -68,13 +68,16 @@
 return str_replace($from, $to, $name);
 }
 
- function renamePages(&$dbi, &$request, $pages, $from, $to, $updatelinks=false, $createredirect=false) {
+ function renamePages(&$dbi, &$request, $pages, $from, $to, $updatelinks=false, 
+ $createredirect=false) 
+ {
 $result = HTML::div();
 $ul = HTML::ul();
 $count = 0;
 $post_args = $request->getArg('admin_rename');
- $options = array('regex' => @$post_args['regex'],
- 'icase' => @$post_args['icase']);
+ $options = 
+ array('regex' => isset($post_args['regex']) ? $post_args['regex'] : null,
+ 'icase' => isset($post_args['icase']) ? $post_args['icase'] : null);
 foreach ($pages as $name) {
 if ( ($newname = $this->renameHelper($name, $from, $to, $options)) 
 and $newname != $name )
@@ -86,21 +89,12 @@
 $ul->pushContent(HTML::li(fmt("Access denied to rename page '%s'.",
 WikiLink($name))));
 elseif ( $dbi->renamePage($name, $newname, $updatelinks)) {
- /* not yet implemented for all backends */
- $page = $dbi->getPage($newname);
- $current = $page->getCurrentRevision();
- $version = $current->getVersion();
- $meta = $current->_data;
- $text = $current->getPackedContent();
- $meta['summary'] = sprintf(_("Renamed page from '%s' to '%s'"), $name, $newname);
- $meta['is_minor_edit'] = 1;
- $meta['author'] = $request->_user->UserName();
- unset($meta['mtime']); // force new date
- $page->save($text, $version + 1, $meta);
 if ($createredirect) {
 $page = $dbi->getPage($name);
 $text = "<<RedirectTo page=\"" . $newname . "\">>";
- $meta['summary'] = sprintf(_("Renaming created redirect page from '%s' to '%s'"), $name, $newname);
+ $meta['summary'] = 
+ sprintf(_("Renaming created redirect page from '%s' to '%s'"),
+ $name, $newname);
 $meta['is_minor_edit'] = 0;
 $meta['author'] = $request->_user->UserName();
 $page->save($text, 1, $meta);
@@ -121,9 +115,11 @@
 $dbi->touch();
 $result->setAttr('class', 'feedback');
 if ($count == 1) {
- $result->pushContent(HTML::p("One page has been permanently renamed:"));
+ $result->pushContent(HTML::p(
+ "One page has been permanently renamed:"));
 } else {
- $result->pushContent(HTML::p(fmt("%s pages have been permanently renamed:", $count)));
+ $result->pushContent(HTML::p(
+ fmt("%s pages have been permanently renamed:", $count)));
 }
 $result->pushContent($ul);
 return $result;
@@ -176,17 +172,18 @@
 !empty($post_args['updatelinks']),
 !empty($post_args['createredirect']));
 }
- if ($post_args['action'] == 'select') {
- if (!empty($post_args['from']))
- $next_action = 'verify';
- foreach ($p as $name => $c) {
- $pages[$name] = 1;
- }
+ }
+ if ($post_args['action'] == 'select') {
+ if (!empty($post_args['from']))
+ $next_action = 'verify';
+ foreach ($p as $name => $c) {
+ $pages[$name] = 1;
 }
 }
 if ($next_action == 'select' and empty($pages)) {
 // List all pages to select from.
- $pages = $this->collectPages($pages, $dbi, $args['sortby'], $args['limit'], $args['exclude']);
+ $pages = $this->collectPages($pages, $dbi, $args['sortby'],
+ $args['limit'], $args['exclude']);
 }
 /*if ($next_action == 'verify') {
 $args['info'] = "checkbox,pagename,renamed_pagename";
@@ -223,8 +220,9 @@
 }
 }
 
- $buttons = HTML::p(Button('submit:admin_rename[rename]', $button_label, 'wikiadmin'),
- Button('submit:admin_rename[cancel]', _("Cancel"), 'button'));
+ $buttons = HTML::p
+ (Button('submit:admin_rename[rename]', $button_label, 'wikiadmin'),
+ Button('submit:admin_rename[cancel]', _("Cancel"), 'button'));
 
 if ($singlepage === false) {
 $list = $pagelist->getContent();
@@ -244,7 +242,8 @@
 HiddenInputs(array('admin_rename[action]' => $next_action)),
 ENABLE_PAGEPERM
 ? ''
- : HiddenInputs(array('require_authority_for_post' => WIKIAUTH_ADMIN))));
+ : HiddenInputs(array('require_authority_for_post'
+ => WIKIAUTH_ADMIN))));
 }
 
 function checkBox (&$post_args, $name, $msg) {
@@ -269,14 +268,18 @@
 					 'size' => 90,
 					 'value' => $post_args['to'])));
 if ($singlepage === false) {
-	 $this->_tablePush($table, '', $this->checkBox($post_args, 'regex', _("Regex?")));
- $this->_tablePush($table, '', $this->checkBox($post_args, 'icase', _("Case insensitive?")));
+	 $this->_tablePush($table, '', 
+ $this->checkBox($post_args, 'regex', _("Regex?")));
+ $this->_tablePush($table, '', 
+ $this->checkBox($post_args, 'icase', _("Case insensitive?")));
 }
 	if (DEBUG) // not yet stable
-	 $this->_tablePush($table, '', $this->checkBox($post_args, 'updatelinks', 
-						 _("Change pagename in all linked pages also?")));
-	$this->_tablePush($table, '', $this->checkBox($post_args, 'createredirect', 
-						 _("Create redirect from old to new name?")));
+	 $this->_tablePush($table, '', 
+ $this->checkBox($post_args, 'updatelinks', 
+ _("Change pagename in all linked pages also?")));
+	$this->_tablePush($table, '', 
+ $this->checkBox($post_args, 'createredirect', 
+ _("Create redirect from old to new name?")));
 $header->pushContent($table);
 return $header;
 }
@@ -294,10 +297,12 @@
 $options = array('regex' => @$post_args['regex'],
 'icase' => @$post_args['icase']);
 
- $value = $post_args ? WikiPlugin_WikiAdminRename::renameHelper($page_handle->getName(), 
- $post_args['from'], $post_args['to'],
- $options)
- : $page_handle->getName(); 
+ $value = $post_args 
+ ? WikiPlugin_WikiAdminRename::renameHelper
+ ($page_handle->getName(), 
+ $post_args['from'], $post_args['to'],
+ $options)
+ : $page_handle->getName(); 
 $div = HTML::div(" => ",HTML::input(array('type' => 'text',
 'name' => 'rename[]',
 'value' => $value)));
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 7147
 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7147&view=rev
Author: vargenau
Date: 2009年09月21日 12:20:37 +0000 (2009年9月21日)
Log Message:
-----------
Partial revert: put renaming in page history
Modified Paths:
--------------
 trunk/lib/plugin/WikiAdminRename.php
Modified: trunk/lib/plugin/WikiAdminRename.php
===================================================================
--- trunk/lib/plugin/WikiAdminRename.php	2009年09月21日 10:12:51 UTC (rev 7146)
+++ trunk/lib/plugin/WikiAdminRename.php	2009年09月21日 12:20:37 UTC (rev 7147)
@@ -89,6 +89,17 @@
 $ul->pushContent(HTML::li(fmt("Access denied to rename page '%s'.",
 WikiLink($name))));
 elseif ( $dbi->renamePage($name, $newname, $updatelinks)) {
+ /* not yet implemented for all backends */
+ $page = $dbi->getPage($newname);
+ $current = $page->getCurrentRevision();
+ $version = $current->getVersion();
+ $meta = $current->_data;
+ $text = $current->getPackedContent();
+ $meta['summary'] = sprintf(_("Renamed page from '%s' to '%s'"), $name, $newname);
+ $meta['is_minor_edit'] = 1;
+ $meta['author'] = $request->_user->UserName();
+ unset($meta['mtime']); // force new date
+ $page->save($text, $version + 1, $meta);
 if ($createredirect) {
 $page = $dbi->getPage($name);
 $text = "<<RedirectTo page=\"" . $newname . "\">>";
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 8007
 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=8007&view=rev
Author: vargenau
Date: 2011年03月31日 09:25:39 +0000 (2011年3月31日)
Log Message:
-----------
Translate string
Modified Paths:
--------------
 trunk/lib/plugin/WikiAdminRename.php
Modified: trunk/lib/plugin/WikiAdminRename.php
===================================================================
--- trunk/lib/plugin/WikiAdminRename.php	2011年03月31日 08:54:16 UTC (rev 8006)
+++ trunk/lib/plugin/WikiAdminRename.php	2011年03月31日 09:25:39 UTC (rev 8007)
@@ -236,7 +236,7 @@
 return HTML::form(array('action' => $request->getPostURL(),
 'method' => 'post'),
 HTML::fieldset(
- HTML::legend("Rename page"),
+ HTML::legend(_("Rename page")),
 $header,
 $buttons,
 $list,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 8040
 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=8040&view=rev
Author: vargenau
Date: 2011年04月13日 11:26:19 +0000 (2011年4月13日)
Log Message:
-----------
Avoid warnings
Modified Paths:
--------------
 trunk/lib/plugin/WikiAdminRename.php
Modified: trunk/lib/plugin/WikiAdminRename.php
===================================================================
--- trunk/lib/plugin/WikiAdminRename.php	2011年04月13日 09:58:48 UTC (rev 8039)
+++ trunk/lib/plugin/WikiAdminRename.php	2011年04月13日 11:26:19 UTC (rev 8040)
@@ -53,12 +53,13 @@
 }
 
 function renameHelper($name, $from, $to, $options = false) {
- if ($options['regex'])
- return preg_replace('/'.$from.'/'.($options['icase']?'i':''), $to, $name);
- elseif ($options['icase'])
- return str_ireplace($from, $to, $name);
- else
+ if (isset($options['regex'])) {
+ return preg_replace('/'.$from.'/'.(isset($options['icase'])?'i':''), $to, $name);
+ } elseif (isset($options['icase'])) {
+ return str_ireplace($from, $to, $name);
+ } else {
 return str_replace($from, $to, $name);
+ }
 }
 
 function renamePages(&$dbi, &$request, $pages, $from, $to, $updatelinks=false,
@@ -299,9 +300,9 @@
 function _getValue ($page_handle, &$revision_handle) {
 global $request;
 $post_args = $request->getArg('admin_rename');
- $options = array('regex' => @$post_args['regex'],
- 'icase' => @$post_args['icase']);
-
+ $options =
+ array('regex' => isset($post_args['regex']) ? $post_args['regex'] : null,
+ 'icase' => isset($post_args['icase']) ? $post_args['icase'] : null);
 $value = $post_args
 ? WikiPlugin_WikiAdminRename::renameHelper
 ($page_handle->getName(),
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 8273
 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=8273&view=rev
Author: vargenau
Date: 2012年06月11日 09:37:49 +0000 (2012年6月11日)
Log Message:
-----------
Add readonly to from
Modified Paths:
--------------
 trunk/lib/plugin/WikiAdminRename.php
Modified: trunk/lib/plugin/WikiAdminRename.php
===================================================================
--- trunk/lib/plugin/WikiAdminRename.php	2012年06月11日 09:32:54 UTC (rev 8272)
+++ trunk/lib/plugin/WikiAdminRename.php	2012年06月11日 09:37:49 UTC (rev 8273)
@@ -271,6 +271,7 @@
 HTML::input(array('name' => 'admin_rename[from]',
 'size' => MAX_PAGENAME_LENGTH,
 'maxlength' => MAX_PAGENAME_LENGTH,
+ 'readonly' => 'readonly',
 'value' => $post_args['from'])));
 $this->_tablePush($table, _("to")._(": "),
 HTML::input(array('name' => 'admin_rename[to]',
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 8271
 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=8271&view=rev
Author: vargenau
Date: 2012年06月11日 09:19:19 +0000 (2012年6月11日)
Log Message:
-----------
Cannot rename. New page name too long.
Modified Paths:
--------------
 trunk/lib/plugin/WikiAdminRename.php
Modified: trunk/lib/plugin/WikiAdminRename.php
===================================================================
--- trunk/lib/plugin/WikiAdminRename.php	2012年06月11日 08:54:58 UTC (rev 8270)
+++ trunk/lib/plugin/WikiAdminRename.php	2012年06月11日 09:19:19 UTC (rev 8271)
@@ -76,7 +76,9 @@
 if ( ($newname = $this->renameHelper($name, $from, $to, $options))
 and $newname != $name )
 {
- if ($dbi->isWikiPage($newname))
+ if (strlen($newname) > MAX_PAGENAME_LENGTH)
+ $ul->pushContent(HTML::li(_("Cannot rename. New page name too long.")));
+ elseif ($dbi->isWikiPage($newname))
 $ul->pushContent(HTML::li(fmt("Page '%s' already exists. Ignored.",
 WikiLink($newname))));
 elseif (! mayAccessPage('edit', $name))
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 8272
 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=8272&view=rev
Author: vargenau
Date: 2012年06月11日 09:32:54 +0000 (2012年6月11日)
Log Message:
-----------
Add maxlength
Modified Paths:
--------------
 trunk/lib/plugin/WikiAdminRename.php
Modified: trunk/lib/plugin/WikiAdminRename.php
===================================================================
--- trunk/lib/plugin/WikiAdminRename.php	2012年06月11日 09:19:19 UTC (rev 8271)
+++ trunk/lib/plugin/WikiAdminRename.php	2012年06月11日 09:32:54 UTC (rev 8272)
@@ -269,11 +269,13 @@
 $table = HTML::table();
 $this->_tablePush($table, _("Rename"). " ". _("from")._(": "),
 HTML::input(array('name' => 'admin_rename[from]',
- 'size' => 90,
+ 'size' => MAX_PAGENAME_LENGTH,
+ 'maxlength' => MAX_PAGENAME_LENGTH,
 'value' => $post_args['from'])));
 $this->_tablePush($table, _("to")._(": "),
 HTML::input(array('name' => 'admin_rename[to]',
- 'size' => 90,
+ 'size' => MAX_PAGENAME_LENGTH,
+ 'maxlength' => MAX_PAGENAME_LENGTH,
 'value' => $post_args['to'])));
 if ($singlepage === false) {
 $this->_tablePush($table, '',
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 8782
 http://sourceforge.net/p/phpwiki/code/8782
Author: vargenau
Date: 2013年05月17日 12:54:24 +0000 (2013年5月17日)
Log Message:
-----------
Put private function after public ones
Modified Paths:
--------------
 trunk/lib/plugin/WikiAdminRename.php
Modified: trunk/lib/plugin/WikiAdminRename.php
===================================================================
--- trunk/lib/plugin/WikiAdminRename.php	2013年05月16日 08:53:59 UTC (rev 8781)
+++ trunk/lib/plugin/WikiAdminRename.php	2013年05月17日 12:54:24 UTC (rev 8782)
@@ -66,80 +66,6 @@
 }
 }
 
- private function renamePages(&$dbi, &$request, $pages, $from, $to, $updatelinks = false,
- $createredirect = false)
- {
- $result = HTML::div();
- $ul = HTML::ul();
- $count = 0;
- $post_args = $request->getArg('admin_rename');
- $options =
- array('regex' => isset($post_args['regex']) ? $post_args['regex'] : null,
- 'icase' => isset($post_args['icase']) ? $post_args['icase'] : null);
- foreach ($pages as $name) {
- if (($newname = $this->renameHelper($name, $from, $to, $options))
- and $newname != $name
- ) {
- if (strlen($newname) > MAX_PAGENAME_LENGTH)
- $ul->pushContent(HTML::li(_("Cannot rename. New page name too long.")));
- elseif ($dbi->isWikiPage($newname))
- $ul->pushContent(HTML::li(fmt("Page "%s" already exists. Ignored.",
- WikiLink($newname)))); elseif (!mayAccessPage('edit', $name))
- $ul->pushContent(HTML::li(fmt("Access denied to rename page "%s".",
- WikiLink($name)))); elseif ($dbi->renamePage($name, $newname, $updatelinks)) {
- /* not yet implemented for all backends */
- $page = $dbi->getPage($newname);
- $current = $page->getCurrentRevision();
- $version = $current->getVersion();
- $meta = $current->_data;
- $text = $current->getPackedContent();
- $meta['summary'] = sprintf(_("Renamed page from "%s" to "%s"."), $name, $newname);
- $meta['is_minor_edit'] = 1;
- $meta['author'] = $request->_user->UserName();
- unset($meta['mtime']); // force new date
- $page->save($text, $version + 1, $meta);
- if ($createredirect) {
- $page = $dbi->getPage($name);
- $text = "<<RedirectTo page=\"" . $newname . "\">>";
- $meta['summary'] =
- sprintf(_("Renaming created redirect page from "%s" to "%s""),
- $name, $newname);
- $meta['is_minor_edit'] = 0;
- $meta['author'] = $request->_user->UserName();
- $page->save($text, 1, $meta);
- }
- $ul->pushContent(HTML::li(fmt("Renamed page from "%s" to "%s".",
- $name, WikiLink($newname))));
- $count++;
- } else {
- $ul->pushContent(HTML::li(fmt("Couldn't rename page "%s" to "%s".",
- $name, $newname)));
- }
- } else {
- $ul->pushContent(HTML::li(fmt("Couldn't rename page "%s" to "%s".",
- $name, $newname)));
- }
- }
- if ($count) {
- $dbi->touch();
- $result->setAttr('class', 'feedback');
- if ($count == 1) {
- $result->pushContent(HTML::p(
- _("One page has been renamed:")));
- } else {
- $result->pushContent(HTML::p(
- fmt("%d pages have been renamed:", $count)));
- }
- $result->pushContent($ul);
- return $result;
- } else {
- $result->setAttr('class', 'error');
- $result->pushContent(HTML::p(fmt("No pages renamed.")));
- $result->pushContent($ul);
- return $result;
- }
- }
-
 function run($dbi, $argstr, &$request, $basepage)
 {
 $action = $request->getArg('action');
@@ -271,6 +197,80 @@
 return HTML::div($checkbox, ' ', HTML::label(array('for' => $id), $msg));
 }
 
+ private function renamePages(&$dbi, &$request, $pages, $from, $to, $updatelinks = false,
+ $createredirect = false)
+ {
+ $result = HTML::div();
+ $ul = HTML::ul();
+ $count = 0;
+ $post_args = $request->getArg('admin_rename');
+ $options =
+ array('regex' => isset($post_args['regex']) ? $post_args['regex'] : null,
+ 'icase' => isset($post_args['icase']) ? $post_args['icase'] : null);
+ foreach ($pages as $name) {
+ if (($newname = $this->renameHelper($name, $from, $to, $options))
+ and $newname != $name
+ ) {
+ if (strlen($newname) > MAX_PAGENAME_LENGTH)
+ $ul->pushContent(HTML::li(_("Cannot rename. New page name too long.")));
+ elseif ($dbi->isWikiPage($newname))
+ $ul->pushContent(HTML::li(fmt("Page "%s" already exists. Ignored.",
+ WikiLink($newname)))); elseif (!mayAccessPage('edit', $name))
+ $ul->pushContent(HTML::li(fmt("Access denied to rename page "%s".",
+ WikiLink($name)))); elseif ($dbi->renamePage($name, $newname, $updatelinks)) {
+ /* not yet implemented for all backends */
+ $page = $dbi->getPage($newname);
+ $current = $page->getCurrentRevision();
+ $version = $current->getVersion();
+ $meta = $current->_data;
+ $text = $current->getPackedContent();
+ $meta['summary'] = sprintf(_("Renamed page from "%s" to "%s"."), $name, $newname);
+ $meta['is_minor_edit'] = 1;
+ $meta['author'] = $request->_user->UserName();
+ unset($meta['mtime']); // force new date
+ $page->save($text, $version + 1, $meta);
+ if ($createredirect) {
+ $page = $dbi->getPage($name);
+ $text = "<<RedirectTo page=\"" . $newname . "\">>";
+ $meta['summary'] =
+ sprintf(_("Renaming created redirect page from "%s" to "%s""),
+ $name, $newname);
+ $meta['is_minor_edit'] = 0;
+ $meta['author'] = $request->_user->UserName();
+ $page->save($text, 1, $meta);
+ }
+ $ul->pushContent(HTML::li(fmt("Renamed page from "%s" to "%s".",
+ $name, WikiLink($newname))));
+ $count++;
+ } else {
+ $ul->pushContent(HTML::li(fmt("Couldn't rename page "%s" to "%s".",
+ $name, $newname)));
+ }
+ } else {
+ $ul->pushContent(HTML::li(fmt("Couldn't rename page "%s" to "%s".",
+ $name, $newname)));
+ }
+ }
+ if ($count) {
+ $dbi->touch();
+ $result->setAttr('class', 'feedback');
+ if ($count == 1) {
+ $result->pushContent(HTML::p(
+ _("One page has been renamed:")));
+ } else {
+ $result->pushContent(HTML::p(
+ fmt("%d pages have been renamed:", $count)));
+ }
+ $result->pushContent($ul);
+ return $result;
+ } else {
+ $result->setAttr('class', 'error');
+ $result->pushContent(HTML::p(fmt("No pages renamed.")));
+ $result->pushContent($ul);
+ return $result;
+ }
+ }
+
 private function renameForm(&$header, $post_args, $singlepage)
 {
 $table = HTML::table();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 9295
 http://sourceforge.net/p/phpwiki/code/9295
Author: vargenau
Date: 2014年11月09日 18:12:06 +0000 (2014年11月09日)
Log Message:
-----------
function renameHelper is static
Modified Paths:
--------------
 trunk/lib/plugin/WikiAdminRename.php
Modified: trunk/lib/plugin/WikiAdminRename.php
===================================================================
--- trunk/lib/plugin/WikiAdminRename.php	2014年11月09日 18:10:01 UTC (rev 9294)
+++ trunk/lib/plugin/WikiAdminRename.php	2014年11月09日 18:12:06 UTC (rev 9295)
@@ -50,7 +50,7 @@
 ));
 }
 
- public function renameHelper($name, $from, $to, $options = false)
+ public static function renameHelper($name, $from, $to, $options = array())
 {
 if (isset($options['regex'])) {
 return preg_replace('/' . $from . '/' . (isset($options['icase']) ? 'i' : ''), $to, $name);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 9936
 http://sourceforge.net/p/phpwiki/code/9936
Author: vargenau
Date: 2016年10月06日 15:52:28 +0000 (2016年10月06日)
Log Message:
-----------
Fix bug: it was possible to rename a page to a name with illegal characters, like []
Modified Paths:
--------------
 trunk/lib/plugin/WikiAdminRename.php
Modified: trunk/lib/plugin/WikiAdminRename.php
===================================================================
--- trunk/lib/plugin/WikiAdminRename.php	2016年09月29日 16:43:59 UTC (rev 9935)
+++ trunk/lib/plugin/WikiAdminRename.php	2016年10月06日 15:52:28 UTC (rev 9936)
@@ -1,8 +1,7 @@
 <?php
-
-/*
- * Copyright 2004,2005,2007 $ThePhpWikiProgrammingTeam
- * Copyright 2008-2009 Marc-Etienne Vargenau, Alcatel-Lucent
+/**
+ * Copyright © 2004,2005,2007 $ThePhpWikiProgrammingTeam
+ * Copyright © 2008-2009 Marc-Etienne Vargenau, Alcatel-Lucent
 *
 * This file is part of PhpWiki.
 *
@@ -19,6 +18,9 @@
 * You should have received a copy of the GNU General Public License along
 * with PhpWiki; if not, write to the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ *
 */
 
 /**
@@ -26,6 +28,7 @@
 * @author: Reini Urban <ru...@x-...>
 *
 */
+
 require_once 'lib/PageList.php';
 require_once 'lib/plugin/WikiAdminSelect.php';
 
@@ -91,12 +94,15 @@
 $this->preSelectS($args, $request);
 
 $p = $request->getArg('p');
- if (!$p) $p = $this->_list;
+ if (!$p) {
+ $p = $this->_list;
+ }
 $post_args = $request->getArg('admin_rename');
 $next_action = 'select';
 $pages = array();
- if ($p && !$request->isPost())
+ if ($p && !$request->isPost()) {
 $pages = $p;
+ }
 if ($p && $request->isPost() &&
 !empty($post_args['rename']) && empty($post_args['cancel'])
 ) {
@@ -115,8 +121,9 @@
 }
 }
 if ($post_args['action'] == 'select') {
- if (!empty($post_args['from']))
+ if (!empty($post_args['from'])) {
 $next_action = 'verify';
+ }
 foreach ($p as $name => $c) {
 $pages[$name] = 1;
 }
@@ -193,8 +200,9 @@
 'name' => 'admin_rename[' . $name . ']',
 'id' => $id,
 'value' => 1));
- if (!empty($post_args[$name]))
+ if (!empty($post_args[$name])) {
 $checkbox->setAttr('checked', 'checked');
+ }
 return HTML::div($checkbox, ' ', HTML::label(array('for' => $id), $msg));
 }
 
@@ -212,13 +220,18 @@
 if (($newname = $this->renameHelper($name, $from, $to, $options))
 and $newname != $name
 ) {
- if (strlen($newname) > MAX_PAGENAME_LENGTH)
+ if (strlen($newname) > MAX_PAGENAME_LENGTH) {
 $ul->pushContent(HTML::li(_("Cannot rename. New page name too long.")));
- elseif ($dbi->isWikiPage($newname))
+ } elseif (preg_match("/[<\[\{\|\"\}\]>]/", $newname, $matches) > 0) {
+ $ul->pushContent(HTML::li(
+ sprintf(_("Illegal character "%s" in page name."), $matches[0])));
+ } elseif ($dbi->isWikiPage($newname)) {
 $ul->pushContent(HTML::li(fmt("Page "%s" already exists. Ignored.",
- WikiLink($newname)))); elseif (!mayAccessPage('edit', $name))
+ WikiLink($newname))));
+ } elseif (!mayAccessPage('edit', $name)) {
 $ul->pushContent(HTML::li(fmt("Access denied to rename page "%s".",
- WikiLink($name)))); elseif ($dbi->renamePage($name, $newname, $updatelinks)) {
+ WikiLink($name))));
+ } elseif ($dbi->renamePage($name, $newname, $updatelinks)) {
 /* not yet implemented for all backends */
 $page = $dbi->getPage($newname);
 $current = $page->getCurrentRevision();
@@ -292,10 +305,11 @@
 $this->tablePush($table, '',
 $this->checkBox($post_args, 'icase', _("Case insensitive?")));
 }
- if (defined('EXPERIMENTAL') and EXPERIMENTAL) // not yet stable
+ if (defined('EXPERIMENTAL') and EXPERIMENTAL) { // not yet stable
 $this->tablePush($table, '',
 $this->checkBox($post_args, 'updatelinks',
 _("Change pagename in all linked pages also?")));
+ }
 $this->tablePush($table, '',
 $this->checkBox($post_args, 'createredirect',
 _("Create redirect from old to new name?")));
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 10370
 http://sourceforge.net/p/phpwiki/code/10370
Author: vargenau
Date: 2021年07月27日 14:34:44 +0000 (2021年7月27日)
Log Message:
-----------
lib/plugin/WikiAdminRename.php: old name is readonly only when it is a single page
Modified Paths:
--------------
 trunk/lib/plugin/WikiAdminRename.php
Modified: trunk/lib/plugin/WikiAdminRename.php
===================================================================
--- trunk/lib/plugin/WikiAdminRename.php	2021年07月27日 13:32:39 UTC (rev 10369)
+++ trunk/lib/plugin/WikiAdminRename.php	2021年07月27日 14:34:44 UTC (rev 10370)
@@ -296,12 +296,20 @@
 private function renameForm(&$header, $post_args, $singlepage)
 {
 $table = HTML::table();
- $this->tablePush($table, _("Rename") . " " . _("from") . _(": "),
- HTML::input(array('name' => 'admin_rename[from]',
- 'size' => MAX_PAGENAME_LENGTH,
- 'maxlength' => MAX_PAGENAME_LENGTH,
- 'readonly' => 'readonly',
- 'value' => $post_args['from'])));
+ if ($singlepage) {
+ $this->tablePush($table, _("Rename") . " " . _("from") . _(": "),
+ HTML::input(array('name' => 'admin_rename[from]',
+ 'size' => MAX_PAGENAME_LENGTH,
+ 'maxlength' => MAX_PAGENAME_LENGTH,
+ 'readonly' => 'readonly',
+ 'value' => $post_args['from'])));
+ } else {
+ $this->tablePush($table, _("Rename") . " " . _("from") . _(": "),
+ HTML::input(array('name' => 'admin_rename[from]',
+ 'size' => MAX_PAGENAME_LENGTH,
+ 'maxlength' => MAX_PAGENAME_LENGTH,
+ 'value' => $post_args['from'])));
+ }
 $this->tablePush($table, _("to") . _(": "),
 HTML::input(array('name' => 'admin_rename[to]',
 'size' => MAX_PAGENAME_LENGTH,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 10371
 http://sourceforge.net/p/phpwiki/code/10371
Author: vargenau
Date: 2021年07月27日 15:40:26 +0000 (2021年7月27日)
Log Message:
-----------
lib/plugin/WikiAdminRename.php: "to" field is readonly when confirming
Modified Paths:
--------------
 trunk/lib/plugin/WikiAdminRename.php
Modified: trunk/lib/plugin/WikiAdminRename.php
===================================================================
--- trunk/lib/plugin/WikiAdminRename.php	2021年07月27日 14:34:44 UTC (rev 10370)
+++ trunk/lib/plugin/WikiAdminRename.php	2021年07月27日 15:40:26 UTC (rev 10371)
@@ -150,7 +150,7 @@
 $header->pushContent(
 HTML::p(HTML::strong(
 _("Are you sure you want to rename the selected pages?"))));
- $header = $this->renameForm($header, $post_args, $singlepage);
+ $header = $this->renameForm($header, $post_args, $singlepage, true);
 } else {
 if ($singlepage === true) {
 $button_label = _("Rename Page");
@@ -293,7 +293,7 @@
 }
 }
 
- private function renameForm(&$header, $post_args, $singlepage)
+ private function renameForm(&$header, $post_args, $singlepage, $confirm=false)
 {
 $table = HTML::table();
 if ($singlepage) {
@@ -310,11 +310,20 @@
 'maxlength' => MAX_PAGENAME_LENGTH,
 'value' => $post_args['from'])));
 }
- $this->tablePush($table, _("to") . _(": "),
- HTML::input(array('name' => 'admin_rename[to]',
- 'size' => MAX_PAGENAME_LENGTH,
- 'maxlength' => MAX_PAGENAME_LENGTH,
- 'value' => $post_args['to'])));
+ if ($confirm) {
+ $this->tablePush($table, _("to") . _(": "),
+ HTML::input(array('name' => 'admin_rename[to]',
+ 'size' => MAX_PAGENAME_LENGTH,
+ 'maxlength' => MAX_PAGENAME_LENGTH,
+ 'readonly' => 'readonly',
+ 'value' => $post_args['to'])));
+ } else {
+ $this->tablePush($table, _("to") . _(": "),
+ HTML::input(array('name' => 'admin_rename[to]',
+ 'size' => MAX_PAGENAME_LENGTH,
+ 'maxlength' => MAX_PAGENAME_LENGTH,
+ 'value' => $post_args['to'])));
+ }
 if ($singlepage === false) {
 $this->tablePush($table, '',
 $this->checkBox($post_args, 'regex', _("Regex?")));
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 10560
 http://sourceforge.net/p/phpwiki/code/10560
Author: vargenau
Date: 2021年09月17日 10:48:53 +0000 (2021年9月17日)
Log Message:
-----------
lib/plugin/WikiAdminRename.php: avoid warning
Modified Paths:
--------------
 trunk/lib/plugin/WikiAdminRename.php
Modified: trunk/lib/plugin/WikiAdminRename.php
===================================================================
--- trunk/lib/plugin/WikiAdminRename.php	2021年09月17日 08:59:20 UTC (rev 10559)
+++ trunk/lib/plugin/WikiAdminRename.php	2021年09月17日 10:48:53 UTC (rev 10560)
@@ -120,7 +120,7 @@
 !empty($post_args['createredirect']));
 }
 }
- if ($post_args['action'] == 'select') {
+ if (is_array($post_args) && ($post_args['action'] == 'select')) {
 if (!empty($post_args['from'])) {
 $next_action = 'verify';
 }
@@ -133,9 +133,6 @@
 $pages = $this->collectPages($pages, $dbi, $args['sortby'],
 $args['limit'], $args['exclude']);
 }
- /*if ($next_action == 'verify') {
- $args['info'] = "checkbox,pagename,renamed_pagename";
- }*/
 $pagelist = new PageList_Selectable(
 $args['info'], $args['exclude'],
 array('types' =>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 10757
 http://sourceforge.net/p/phpwiki/code/10757
Author: vargenau
Date: 2021年12月09日 14:32:59 +0000 (2021年12月09日)
Log Message:
-----------
WikiAdminRename plugin: factor code, avoid warning, private functions
Modified Paths:
--------------
 trunk/lib/plugin/WikiAdminRename.php
Modified: trunk/lib/plugin/WikiAdminRename.php
===================================================================
--- trunk/lib/plugin/WikiAdminRename.php	2021年12月09日 13:59:17 UTC (rev 10756)
+++ trunk/lib/plugin/WikiAdminRename.php	2021年12月09日 14:32:59 UTC (rev 10757)
@@ -190,7 +190,7 @@
 => WIKIAUTH_ADMIN))));
 }
 
- private function checkBox(&$post_args, $name, $msg)
+ private function checkBox($post_args, $name, $msg)
 {
 $id = 'admin_rename-' . $name;
 $checkbox = HTML::input(array('type' => 'checkbox',
@@ -203,7 +203,7 @@
 return HTML::div($checkbox, ' ', HTML::label(array('for' => $id), $msg));
 }
 
- private function renamePages(&$dbi, &$request, $pages, $from, $to, $updatelinks = false,
+ private function renamePages($dbi, $request, $pages, $from, $to, $updatelinks = false,
 $createredirect = false)
 {
 $result = HTML::div();
@@ -279,18 +279,19 @@
 $result->pushContent(HTML::p(
 fmt("%d pages have been renamed:", $count)));
 }
- $result->pushContent($ul);
- return $result;
 } else {
 $result->setAttr('class', 'error');
 $result->pushContent(HTML::p(fmt("No pages renamed.")));
- $result->pushContent($ul);
- return $result;
 }
+ $result->pushContent($ul);
+ return $result;
 }
 
- private function renameForm(&$header, $post_args, $singlepage, $confirm=false)
+ private function renameForm($header, $post_args, $singlepage, $confirm=false)
 {
+ if ($post_args === false) {
+ $post_args = array('from' => '', 'to' => '');
+ }
 $table = HTML::table();
 if ($singlepage) {
 $this->tablePush($table, _("Rename") . " " . _("from") . _(": "),
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 10843
 http://sourceforge.net/p/phpwiki/code/10843
Author: vargenau
Date: 2022年01月06日 09:35:41 +0000 (2022年1月06日)
Log Message:
-----------
lib/plugin/WikiAdminRename.php: selected pages --> following pages
Modified Paths:
--------------
 trunk/lib/plugin/WikiAdminRename.php
Modified: trunk/lib/plugin/WikiAdminRename.php
===================================================================
--- trunk/lib/plugin/WikiAdminRename.php	2022年01月06日 09:31:46 UTC (rev 10842)
+++ trunk/lib/plugin/WikiAdminRename.php	2022年01月06日 09:35:41 UTC (rev 10843)
@@ -26,7 +26,6 @@
 /**
 * Usage: <<WikiAdminRename >> or called via WikiAdminSelect
 * @author: Reini Urban
- *
 */
 
 require_once 'lib/PageList.php';
@@ -131,7 +130,7 @@
 if ($next_action == 'select' and empty($pages)) {
 // List all pages to select from.
 $pages = $this->collectPages($pages, $dbi, $args['sortby'],
- $args['limit'], $args['exclude']);
+ $args['limit'], $args['exclude']);
 }
 $pagelist = new PageList_Selectable(
 $args['info'], $args['exclude'],
@@ -146,7 +145,7 @@
 $button_label = _("Yes");
 $header->pushContent(
 HTML::p(HTML::strong(
- _("Are you sure you want to rename the selected pages?"))));
+ _("Are you sure you want to rename the following pages?"))));
 $header = $this->renameForm($header, $post_args, $singlepage, true);
 } else {
 if ($singlepage === true) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /