*Make protection notice only care about edit rights
authorAaron Schulz <aaron@users.mediawiki.org>
Mon, 27 Aug 2007 19:23:32 +0000 (19:23 +0000)
committerAaron Schulz <aaron@users.mediawiki.org>
Mon, 27 Aug 2007 19:23:32 +0000 (19:23 +0000)
*Pass in edit/move restrictions as extra params. Allow variable fun with that like a template.

includes/Article.php
languages/messages/MessagesEn.php

index 4ae280a..40b85d5 100644 (file)
@@ -893,7 +893,7 @@ class Article {
        }
 
        /*
-       * Output a notice that a page is protected. Only give details for move/edit
+       * Output a notice that a page is protected. Only give details for edit
        * 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
@@ -902,25 +902,18 @@ class Article {
        function addProtectionNotice( $editrestr, $moverestr ) {        
                global $wgOut;
                
-               $editGroups = $moveGroups = wfMsg('protected-anyone');
+               $editGroups = '';
                # Get groups that have each right
                if( !empty( $editrestr ) ) {
                        $permission = ($editrestr[0]=='sysop') ? 'protect' : $editrestr[0];
                        $editGroups = $wgOut->getGroupsWithPermission( $permission );
                        $editGroups = implode( ', ', $editGroups );
                }
-               if( !empty( $moverestr ) ) {
-                       $permission = ($moverestr[0]=='sysop') ? 'protect' : $moverestr[0];
-                       $moveGroups = $wgOut->getGroupsWithPermission( $permission );
-                       $moveGroups = implode( ', ', $moveGroups );
-               }
                # Use general messages if no groups found for a type
-               if( !$editGroups || !$moveGroups ) {
-                       $msg = wfMsg( 'protected-subtitle' );
-               } else if( $editGroups == $moveGroups ) {
-                       $msg = wfMsg( 'protected-subtitle-same', $editGroups, $moveGroups );
+               if( !$editGroups ) {
+                       $msg = wfMsgExt( 'protected-subtitle', array('parsemag') );
                } else {
-                       $msg = wfMsg( 'protected-subtitle-each', $editGroups, $moveGroups );
+                       $msg = wfMsgExt( 'protected-subtitle-edit', array('parsemag'), $editGroups, $editrestr, $moverestr );
                }
                if( $wgOut->getSubtitle() )
                        $msg = " $msg";
index c58ba16..a947f66 100644 (file)
@@ -798,9 +798,7 @@ $2",
 'customcssjsprotected'     => "You do not have permission to edit this page, because it contains another user's personal settings.",
 'ns-specialprotected'      => "Pages in the {{ns:special}} namespace cannot be edited.",
 'protected-subtitle'       => "(This page is protected)",
-'protected-subtitle-same'  => "(This page is protected. Some users ($1) can still edit or move it.)",
-'protected-subtitle-each'  => "(This page is protected. Some users ($1) can still edit it while others ($2) can move it.)",
-'protected-anyone'         => 'anyone',
+'protected-subtitle-edit'  => "(This page is protected. Only certain users ($1) can edit it.)",
 
 # Login and logout pages
 'logouttitle'                => 'User logout',