r25207 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r25206‎ | r25207 | r25208 >
Date:19:37, 27 August 2007
Author:aaron
Status:old
Tags:
Comment:
*Don't reference $moverestr either, makes things more complicated
Modified paths:
  • /trunk/phase3/includes/Article.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Article.php
@@ -742,8 +742,7 @@
743743
744744 if ( $this->mTitle->isProtected() ) {
745745 $editrestr = $this->mTitle->getRestrictions('edit');
746 - $moverestr = $this->mTitle->getRestrictions('move');
747 - $this->addProtectionNotice( $editrestr, $moverestr );
 746+ $this->addProtectionNotice( $editrestr );
748747 }
749748
750749 $outputDone = false;
@@ -897,23 +896,27 @@
898897 * restrictions. Cares only about the first permission in the arrays, which is
899898 * part of a larger shitty inconsistency about requiring several permissions...
900899 * @param Array $editrestr, edit restrictions
901 - * @param Array $moverestr, move restrictions
902900 */
903 - function addProtectionNotice( $editrestr, $moverestr ) {
 901+ function addProtectionNotice( $editrestr ) {
904902 global $wgOut;
 903+
 904+ if( empty($editrestr) )
 905+ return;
 906+
 907+ $permission = $editrestr[0];
 908+ $permission = ($permission=='sysop') ? 'protect' : $permission;
905909
906910 $editGroups = '';
907911 # Get groups that have each right
908 - if( !empty( $editrestr ) ) {
909 - $permission = ($editrestr[0]=='sysop') ? 'protect' : $editrestr[0];
 912+ if( $permission ) {
910913 $editGroups = $wgOut->getGroupsWithPermission( $permission );
911914 $editGroups = implode( ', ', $editGroups );
912915 }
913916 # Use general messages if no groups found for a type
914917 if( !$editGroups ) {
915 - $msg = wfMsgExt( 'protected-subtitle', array('parsemag') );
 918+ $msg = wfMsgExt( 'protected-subtitle', array('parsemag'), $editrestr );
916919 } else {
917 - $msg = wfMsgExt( 'protected-subtitle-edit', array('parsemag'), $editGroups, $editrestr, $moverestr );
 920+ $msg = wfMsgExt( 'protected-subtitle-edit', array('parsemag'), $editGroups, $editrestr );
918921 }
919922 if( $wgOut->getSubtitle() )
920923 $msg = " $msg";

Follow-up revisions

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

Status & tagging log