* (bug 1970) Don't show move tab for immobile pages
authorBrion Vibber <brion@users.mediawiki.org>
Mon, 25 Apr 2005 04:34:46 +0000 (04:34 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Mon, 25 Apr 2005 04:34:46 +0000 (04:34 +0000)
includes/Title.php

index 756705e..fa5c9c6 100644 (file)
@@ -865,6 +865,12 @@ class Title {
                                return false;
                        }
                }
+               
+               if( $action == 'move' && !$this->isMovable() ) {
+                       wfProfileOut( $fname );
+                       return false;
+               }
+               
                wfProfileOut( $fname );
                return true;
        }
@@ -887,6 +893,17 @@ class Title {
                return $this->userCan('move');
        }
 
+       /**
+        * Would anybody with sufficient privileges be able to mvoe this page?
+        * Some pages just ain't movable.
+        *
+        * @return boolean
+        * @access public
+        */
+       function isMovable() {
+               return Namespace::isMovable( $this->getNamespace() );
+       }
+       
        /**
         * Can $wgUser read this page?
         * @return boolean