From 8f8bdca420e69925375edb1777cfca28a9d8b16c Mon Sep 17 00:00:00 2001 From: Antoine Musso Date: Mon, 31 Jan 2005 04:07:56 +0000 Subject: [PATCH] Stop showing moves directly in recentchanges, instead use the logging system (that add an entry in recentchanges). --- includes/LogPage.php | 16 +++++++++++----- includes/SpecialMovepage.php | 5 +---- includes/Title.php | 17 ++++++++++++++--- languages/Language.php | 4 ++++ 4 files changed, 30 insertions(+), 12 deletions(-) diff --git a/includes/LogPage.php b/includes/LogPage.php index 373e9a1310..0684f8463f 100644 --- a/includes/LogPage.php +++ b/includes/LogPage.php @@ -36,7 +36,7 @@ class LogPage { var $updateRecentChanges = true; function LogPage( $type ) { - # Type is one of 'block', 'protect', 'rights', 'delete', 'upload' + # Type is one of 'block', 'protect', 'rights', 'delete', 'upload', 'move' $this->type = $type; } @@ -79,7 +79,7 @@ class LogPage { * @static */ function validTypes() { - static $types = array( '', 'block', 'protect', 'rights', 'delete', 'upload' ); + static $types = array( '', 'block', 'protect', 'rights', 'delete', 'upload', 'move' ); return $types; } @@ -93,7 +93,8 @@ class LogPage { 'protect' => array( 'protect', 'unprotect' ), 'rights' => array( 'rights' ), 'delete' => array( 'delete', 'restore' ), - 'upload' => array( 'upload' ) + 'upload' => array( 'upload' ), + 'move' => array( 'move' ) ); return $actions[$type]; } @@ -116,6 +117,7 @@ class LogPage { 'rights' => 'bureaucratlog', 'delete' => 'dellogpage', 'upload' => 'uploadlogpage', + 'move' => 'movelogpage' ); return str_replace( '_', ' ', wfMsg( $typeText[$type] ) ); } @@ -130,7 +132,8 @@ class LogPage { 'protect' => 'protectlogtext', 'rights' => 'rightslogtext', 'delete' => 'dellogpagetext', - 'upload' => 'uploadlogpagetext' + 'upload' => 'uploadlogpagetext', + 'move' => 'movelogpagetext' ); return wfMsg( $headerText[$type] ); } @@ -149,6 +152,8 @@ class LogPage { 'delete/restore' => 'undeletedarticle', 'upload/upload' => 'uploadedimage', 'upload/revert' => 'uploadedimage', + 'move/move' => '1movedto2', + 'move/move_redir' => '1movedto2_redir' ); $key = "$type/$action"; if( isset( $actions[$key] ) ) { @@ -169,8 +174,9 @@ class LogPage { /** * Add a log entry * @param string $action one of 'block', 'protect', 'rights', 'delete', 'upload' - * @param &$target + * @param object &$target A title object. * @param string $comment Description associated + * @param array $params Parameters passed later to wfMsg.* functions */ function addEntry( $action, &$target, $comment, $params = array() ) { global $wgLang, $wgUser; diff --git a/includes/SpecialMovepage.php b/includes/SpecialMovepage.php index c110f87f14..08c39d9b8e 100644 --- a/includes/SpecialMovepage.php +++ b/includes/SpecialMovepage.php @@ -132,7 +132,6 @@ class MovePageForm { # Variables beginning with 'o' for old article 'n' for new article # Attempt to move the article - $ot = Title::newFromText( $this->oldTitle ); $nt = Title::newFromText( $this->newTitle ); @@ -147,7 +146,7 @@ class MovePageForm { $this->showForm( wfMsg( $error ) ); return; } - + # Update counters if the article got moved into or out of NS_MAIN namespace $ons = $ot->getNamespace(); $nns = $nt->getNamespace(); @@ -172,7 +171,6 @@ class MovePageForm { # (1) the checkbox says to, # (2) the namespaces are not themselves talk namespaces, and of course # (3) it exists. - if ( ( $wgRequest->getVal('wpMovetalk') == 1 ) && ( ! Namespace::isTalk( $ons ) ) && ( ! Namespace::isTalk( $nns ) ) ) { @@ -196,7 +194,6 @@ class MovePageForm { } # Give back result to user. - $titleObj = Title::makeTitle( NS_SPECIAL, 'Movepage' ); $success = $titleObj->getFullURL( 'action=success&oldtitle=' . wfUrlencode( $ot->getPrefixedText() ) . diff --git a/includes/Title.php b/includes/Title.php index b42254ea63..565d8ab599 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -1482,9 +1482,15 @@ class Title { ); $newid = $dbw->insertId(); $wgLinkCache->clearLink( $this->getPrefixedDBkey() ); - - RecentChange::notifyMoveOverRedirect( $now, $this, $nt, $wgUser, $comment ); + # Record in RC + // Replaced by a log entry + // RecentChange::notifyMoveOverRedirect( $now, $this, $nt, $wgUser, $comment ); + + # Log the move + $log = new LogPage( 'move' ); + $log->addEntry( 'move_redir', $this, '', array(1 => $nt->getText()) ); + # Swap links # Load titles and IDs @@ -1606,7 +1612,12 @@ class Title { $wgLinkCache->clearLink( $this->getPrefixedDBkey() ); # Record in RC - RecentChange::notifyMoveToNew( $now, $this, $nt, $wgUser, $comment ); + // Replaced by a log entry + // RecentChange::notifyMoveToNew( $now, $this, $nt, $wgUser, $comment ); + + # Log the move + $log = new LogPage( 'move' ); + $log->addEntry( 'move', $this, '', array(1 => $nt->getText()) ); # Purge squid and linkscc as per article creation Article::onArticleCreate( $nt ); diff --git a/languages/Language.php b/languages/Language.php index 08bd4abf92..dadfe9e9f2 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -909,12 +909,14 @@ from server time (UTC).', 'savegroup' => 'Save Group', # user groups editing +# 'userlevels-editusergroup' => 'Edit user groups', 'saveusergroups' => 'Save User Groups', 'userlevels-groupsmember' => 'Member of:', 'userlevels-groupsavailable' => 'Available groups:', 'userlevels-groupshelp' => 'Select groups you want the user to be removed from or added to. Unselected groups will not be changed. You can unselect a group by using CTRL + Left Click', + # Recent changes # 'changes' => 'changes', @@ -1542,6 +1544,8 @@ title. Please merge them manually.', 'talkpagenotmoved' => 'The corresponding talk page was not moved.', '1movedto2' => "$1 moved to $2", '1movedto2_redir' => '$1 moved to $2 over redirect', +'movelogpage' => 'Move log', +'movelogpagetext' => 'Below is a list of page moved.', # Export -- 2.20.1