r25205 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r25204‎ | r25205 | r25206 >
Date:19:23, 27 August 2007
Author:aaron
Status:old
Tags:
Comment:
*Make protection notice only care about edit rights
*Pass in edit/move restrictions as extra params. Allow variable fun with that like a template.
Modified paths:
  • /trunk/phase3/includes/Article.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesEn.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Article.php
@@ -893,7 +893,7 @@
894894 }
895895
896896 /*
897 - * Output a notice that a page is protected. Only give details for move/edit
 897+ * Output a notice that a page is protected. Only give details for edit
898898 * restrictions. Cares only about the first permission in the arrays, which is
899899 * part of a larger shitty inconsistency about requiring several permissions...
900900 * @param Array $editrestr, edit restrictions
@@ -902,25 +902,18 @@
903903 function addProtectionNotice( $editrestr, $moverestr ) {
904904 global $wgOut;
905905
906 - $editGroups = $moveGroups = wfMsg('protected-anyone');
 906+ $editGroups = '';
907907 # Get groups that have each right
908908 if( !empty( $editrestr ) ) {
909909 $permission = ($editrestr[0]=='sysop') ? 'protect' : $editrestr[0];
910910 $editGroups = $wgOut->getGroupsWithPermission( $permission );
911911 $editGroups = implode( ', ', $editGroups );
912912 }
913 - if( !empty( $moverestr ) ) {
914 - $permission = ($moverestr[0]=='sysop') ? 'protect' : $moverestr[0];
915 - $moveGroups = $wgOut->getGroupsWithPermission( $permission );
916 - $moveGroups = implode( ', ', $moveGroups );
917 - }
918913 # Use general messages if no groups found for a type
919 - if( !$editGroups || !$moveGroups ) {
920 - $msg = wfMsg( 'protected-subtitle' );
921 - } else if( $editGroups == $moveGroups ) {
922 - $msg = wfMsg( 'protected-subtitle-same', $editGroups, $moveGroups );
 914+ if( !$editGroups ) {
 915+ $msg = wfMsgExt( 'protected-subtitle', array('parsemag') );
923916 } else {
924 - $msg = wfMsg( 'protected-subtitle-each', $editGroups, $moveGroups );
 917+ $msg = wfMsgExt( 'protected-subtitle-edit', array('parsemag'), $editGroups, $editrestr, $moverestr );
925918 }
926919 if( $wgOut->getSubtitle() )
927920 $msg = " $msg";
Index: trunk/phase3/languages/messages/MessagesEn.php
@@ -798,9 +798,7 @@
799799 'customcssjsprotected' => "You do not have permission to edit this page, because it contains another user's personal settings.",
800800 'ns-specialprotected' => "Pages in the {{ns:special}} namespace cannot be edited.",
801801 'protected-subtitle' => "(This page is protected)",
802 -'protected-subtitle-same' => "(This page is protected. Some users ($1) can still edit or move it.)",
803 -'protected-subtitle-each' => "(This page is protected. Some users ($1) can still edit it while others ($2) can move it.)",
804 -'protected-anyone' => 'anyone',
 802+'protected-subtitle-edit' => "(This page is protected. Only certain users ($1) can edit it.)",
805803
806804 # Login and logout pages
807805 'logouttitle' => 'User logout',

Follow-up revisions

RevisionCommit summaryAuthorDate
r25223Merged revisions 25126-25214 via svnmerge from...david07:39, 28 August 2007

Status & tagging log