Index: trunk/phase3/includes/Article.php |
— | — | @@ -742,8 +742,7 @@ |
743 | 743 | |
744 | 744 | if ( $this->mTitle->isProtected() ) { |
745 | 745 | $editrestr = $this->mTitle->getRestrictions('edit'); |
746 | | - $moverestr = $this->mTitle->getRestrictions('move'); |
747 | | - $this->addProtectionNotice( $editrestr, $moverestr ); |
| 746 | + $this->addProtectionNotice( $editrestr ); |
748 | 747 | } |
749 | 748 | |
750 | 749 | $outputDone = false; |
— | — | @@ -897,23 +896,27 @@ |
898 | 897 | * restrictions. Cares only about the first permission in the arrays, which is |
899 | 898 | * part of a larger shitty inconsistency about requiring several permissions... |
900 | 899 | * @param Array $editrestr, edit restrictions |
901 | | - * @param Array $moverestr, move restrictions |
902 | 900 | */ |
903 | | - function addProtectionNotice( $editrestr, $moverestr ) { |
| 901 | + function addProtectionNotice( $editrestr ) { |
904 | 902 | global $wgOut; |
| 903 | + |
| 904 | + if( empty($editrestr) ) |
| 905 | + return; |
| 906 | + |
| 907 | + $permission = $editrestr[0]; |
| 908 | + $permission = ($permission=='sysop') ? 'protect' : $permission; |
905 | 909 | |
906 | 910 | $editGroups = ''; |
907 | 911 | # Get groups that have each right |
908 | | - if( !empty( $editrestr ) ) { |
909 | | - $permission = ($editrestr[0]=='sysop') ? 'protect' : $editrestr[0]; |
| 912 | + if( $permission ) { |
910 | 913 | $editGroups = $wgOut->getGroupsWithPermission( $permission ); |
911 | 914 | $editGroups = implode( ', ', $editGroups ); |
912 | 915 | } |
913 | 916 | # Use general messages if no groups found for a type |
914 | 917 | if( !$editGroups ) { |
915 | | - $msg = wfMsgExt( 'protected-subtitle', array('parsemag') ); |
| 918 | + $msg = wfMsgExt( 'protected-subtitle', array('parsemag'), $editrestr ); |
916 | 919 | } else { |
917 | | - $msg = wfMsgExt( 'protected-subtitle-edit', array('parsemag'), $editGroups, $editrestr, $moverestr ); |
| 920 | + $msg = wfMsgExt( 'protected-subtitle-edit', array('parsemag'), $editGroups, $editrestr ); |
918 | 921 | } |
919 | 922 | if( $wgOut->getSubtitle() ) |
920 | 923 | $msg = " $msg"; |