*Don't reference $moverestr either, makes things more complicated
authorAaron Schulz <aaron@users.mediawiki.org>
Mon, 27 Aug 2007 19:37:52 +0000 (19:37 +0000)
committerAaron Schulz <aaron@users.mediawiki.org>
Mon, 27 Aug 2007 19:37:52 +0000 (19:37 +0000)
includes/Article.php

index 40b85d5..6c02ec6 100644 (file)
@@ -742,8 +742,7 @@ class Article {
 
                if ( $this->mTitle->isProtected() ) {
                        $editrestr = $this->mTitle->getRestrictions('edit');
-                       $moverestr = $this->mTitle->getRestrictions('move');
-                       $this->addProtectionNotice( $editrestr, $moverestr );
+                       $this->addProtectionNotice( $editrestr );
                }
 
                $outputDone = false;
@@ -897,23 +896,27 @@ class Article {
        * restrictions. Cares only about the first permission in the arrays, which is
        * part of a larger shitty inconsistency about requiring several permissions...
        * @param Array $editrestr, edit restrictions
-       * @param Array $moverestr, move restrictions
        */
-       function addProtectionNotice( $editrestr, $moverestr ) {        
+       function addProtectionNotice( $editrestr ) {    
                global $wgOut;
+
+               if( empty($editrestr) ) 
+                       return;
+
+               $permission = $editrestr[0];
+               $permission = ($permission=='sysop') ? 'protect' : $permission;
                
                $editGroups = '';
                # Get groups that have each right
-               if( !empty( $editrestr ) ) {
-                       $permission = ($editrestr[0]=='sysop') ? 'protect' : $editrestr[0];
+               if( $permission ) {
                        $editGroups = $wgOut->getGroupsWithPermission( $permission );
                        $editGroups = implode( ', ', $editGroups );
                }
                # Use general messages if no groups found for a type
                if( !$editGroups ) {
-                       $msg = wfMsgExt( 'protected-subtitle', array('parsemag') );
+                       $msg = wfMsgExt( 'protected-subtitle', array('parsemag'), $editrestr );
                } else {
-                       $msg = wfMsgExt( 'protected-subtitle-edit', array('parsemag'), $editGroups, $editrestr, $moverestr );
+                       $msg = wfMsgExt( 'protected-subtitle-edit', array('parsemag'), $editGroups, $editrestr );
                }
                if( $wgOut->getSubtitle() )
                        $msg = " $msg";