From a5878957bc7c2498ac27268ba809fdd5220e00e9 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Mon, 27 Aug 2007 19:23:32 +0000 Subject: [PATCH] *Make protection notice only care about edit rights *Pass in edit/move restrictions as extra params. Allow variable fun with that like a template. --- includes/Article.php | 17 +++++------------ languages/messages/MessagesEn.php | 4 +--- 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/includes/Article.php b/includes/Article.php index 4ae280a814..40b85d5f09 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -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"; diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index c58ba16f4b..a947f66173 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -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', -- 2.20.1