Stop showing moves directly in recentchanges, instead use the logging system (that...
authorAntoine Musso <hashar@users.mediawiki.org>
Mon, 31 Jan 2005 04:07:56 +0000 (04:07 +0000)
committerAntoine Musso <hashar@users.mediawiki.org>
Mon, 31 Jan 2005 04:07:56 +0000 (04:07 +0000)
includes/LogPage.php
includes/SpecialMovepage.php
includes/Title.php
languages/Language.php

index 373e9a1..0684f84 100644 (file)
@@ -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;
index c110f87..08c39d9 100644 (file)
@@ -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() ) .
index b42254e..565d8ab 100644 (file)
@@ -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 );
index 08bd4ab..dadfe9e 100644 (file)
@@ -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 <strong>not</strong> 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