}
// The form will be available in read-only to show levels.
- $this->disabled = ($this->mPermErrors = $this->mTitle->getUserPermissionsErrors('protect',$wgUser)) != array();
+ $this->disabled = wfReadOnly() || ($this->mPermErrors = $this->mTitle->getUserPermissionsErrors('protect',$wgUser)) != array();
$this->disabledAttrib = $this->disabled
? array( 'disabled' => 'disabled' )
: array();
$titles .= '* [[:' . $title->getPrefixedText() . "]]\n";
}
- $notice = wfMsgExt( 'protect-cascadeon', array('parsemag'), count($cascadeSources) ) . "\r\n$titles";
-
- $wgOut->addWikiText( $notice );
+ $wgOut->wrapWikiMsg( "$1\n$titles", array( 'protect-cascadeon', count($cascadeSources) ) );
}
$wgOut->setPageTitle( wfMsg( 'confirmprotect' ) );
# Show an appropriate message if the user isn't allowed or able to change
# the protection settings at this time
if( $this->disabled ) {
- $message = $wgOut->formatPermissionsErrorMessage( $this->mPermErrors );
+ if( wfReadOnly() ) {
+ $wgOut->readOnlyPage();
+ } elseif( $this->mPermErrors ) {
+ $wgOut->addWikiText( $wgOut->formatPermissionsErrorMessage( $this->mPermErrors ) );
+ }
} else {
- $message = wfMsg( 'protect-text', wfEscapeWikiText( $this->mTitle->getPrefixedText() ) );
+ $wgOut->addWikiMsg( 'protect-text', $this->mTitle->getPrefixedText() );
}
- $wgOut->addWikiText( $message );
$wgOut->addHTML( $this->buildForm() );