* Use 1movedto2_redir instead of 1movedto2 in the pages history when moving over...
authorRotem Liss <rotem@users.mediawiki.org>
Mon, 22 Jan 2007 16:53:28 +0000 (16:53 +0000)
committerRotem Liss <rotem@users.mediawiki.org>
Mon, 22 Jan 2007 16:53:28 +0000 (16:53 +0000)
* Removing Title::createRedirect: not used at all in trunk and in the extensions, originally created for the old template namespace script, which was deleted.

includes/FakeTitle.php
includes/Title.php

index 112d2a6..079c635 100644 (file)
@@ -72,7 +72,6 @@ class FakeTitle {
        function moveOverExistingRedirect() { $this->error(); }
        function moveToNewTitle() { $this->error(); }
        function isValidMoveTarget() { $this->error(); }
-       function createRedirect() { $this->error(); }
        function getParentCategories() { $this->error(); }
        function getParentCategoryTree() { $this->error(); }
        function pageCond() { $this->error(); }
index bc5af31..cf1f446 100644 (file)
@@ -2163,7 +2163,7 @@ class Title {
        function moveOverExistingRedirect( &$nt, $reason = '' ) {
                global $wgUseSquid;
                $fname = 'Title::moveOverExistingRedirect';
-               $comment = wfMsgForContent( '1movedto2', $this->getPrefixedText(), $nt->getPrefixedText() );
+               $comment = wfMsgForContent( '1movedto2_redir', $this->getPrefixedText(), $nt->getPrefixedText() );
 
                if ( $reason ) {
                        $comment .= ": $reason";
@@ -2359,46 +2359,6 @@ class Title {
                return $row === false;
        }
 
-       /**
-        * Create a redirect; fails if the title already exists; does
-        * not notify RC
-        *
-        * @param Title $dest the destination of the redirect
-        * @param string $comment the comment string describing the move
-        * @return bool true on success
-        * @access public
-        */
-       function createRedirect( $dest, $comment ) {
-               if ( $this->getArticleID() ) {
-                       return false;
-               }
-
-               $fname = 'Title::createRedirect';
-               $dbw =& wfGetDB( DB_MASTER );
-
-               $article = new Article( $this );
-               $newid = $article->insertOn( $dbw );
-               $revision = new Revision( array(
-                       'page'      => $newid,
-                       'comment'   => $comment,
-                       'text'      => "#REDIRECT [[" . $dest->getPrefixedText() . "]]\n",
-                       ) );
-               $revision->insertOn( $dbw );
-               $article->updateRevisionOn( $dbw, $revision, 0 );
-
-               # Link table
-               $dbw->insert( 'pagelinks',
-                       array(
-                               'pl_from'      => $newid,
-                               'pl_namespace' => $dest->getNamespace(),
-                               'pl_title'     => $dest->getDbKey()
-                       ), $fname
-               );
-
-               Article::onArticleCreate( $this );
-               return true;
-       }
-
        /**
         * Get categories to which this Title belongs and return an array of
         * categories' names.