if ( $this->mTitle->isProtected() ) {
$editrestr = $this->mTitle->getRestrictions('edit');
- $moverestr = $this->mTitle->getRestrictions('move');
- $this->addProtectionNotice( $editrestr, $moverestr );
+ $this->addProtectionNotice( $editrestr );
}
$outputDone = false;
* 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
- * @param Array $moverestr, move restrictions
*/
- function addProtectionNotice( $editrestr, $moverestr ) {
+ function addProtectionNotice( $editrestr ) {
global $wgOut;
+
+ if( empty($editrestr) )
+ return;
+
+ $permission = $editrestr[0];
+ $permission = ($permission=='sysop') ? 'protect' : $permission;
$editGroups = '';
# Get groups that have each right
- if( !empty( $editrestr ) ) {
- $permission = ($editrestr[0]=='sysop') ? 'protect' : $editrestr[0];
+ if( $permission ) {
$editGroups = $wgOut->getGroupsWithPermission( $permission );
$editGroups = implode( ', ', $editGroups );
}
# Use general messages if no groups found for a type
if( !$editGroups ) {
- $msg = wfMsgExt( 'protected-subtitle', array('parsemag') );
+ $msg = wfMsgExt( 'protected-subtitle', array('parsemag'), $editrestr );
} else {
- $msg = wfMsgExt( 'protected-subtitle-edit', array('parsemag'), $editGroups, $editrestr, $moverestr );
+ $msg = wfMsgExt( 'protected-subtitle-edit', array('parsemag'), $editGroups, $editrestr );
}
if( $wgOut->getSubtitle() )
$msg = " $msg";