* (bug 10859) Introduce 'UserGetImplicitGroups' hook; see docs/hooks.txt for
more information
* (bug 10832) Include user information when viewing a deleted revision
+* (bug 10872) Fall back to sane defaults when generating protection selector
+ labels for custom restriction levels
== Bugfixes since 1.10 ==
$out = wfOpenElement( 'select', $attribs );
foreach( $wgRestrictionLevels as $key ) {
- $out .= $this->buildOption( $key, $selected );
+ $out .= Xml::option( $this->getOptionLabel( $key ), $key, $key == $selected );
}
$out .= "</select>\n";
return $out;
}
- function buildOption( $key, $selected ) {
- $text = ( $key == '' )
- ? wfMsg( 'protect-default' )
- : wfMsg( "protect-level-$key" );
- $selectedAttrib = ($selected == $key)
- ? array( 'selected' => 'selected' )
- : array();
- return wfElement( 'option',
- array( 'value' => $key ) + $selectedAttrib,
- $text );
+ /**
+ * Prepare the label for a protection selector option
+ *
+ * @param string $permission Permission required
+ * @return string
+ */
+ private function getOptionLabel( $permission ) {
+ if( $permission == '' ) {
+ return wfMsg( 'protect-default' );
+ } else {
+ $key = "protect-level-{$permission}";
+ $msg = wfMsg( $key );
+ if( wfEmptyMsg( $key, $msg ) )
+ $msg = wfMsg( 'protect-fallback', $permission );
+ return $msg;
+ }
}
function buildReasonInput() {
'type' => 'protect' ) ) ) );
$logViewer->showList( $out );
}
-}
-
+}
\ No newline at end of file
Here are the current settings for the page <strong>$1</strong>:',
'protect-cascadeon' => "This page is currently protected because it is included in the following {{PLURAL:$1|page, which has|pages, which have}} cascading protection turned on. You can change this page's protection level, but it will not affect the cascading protection.",
'protect-default' => '(default)',
+'protect-fallback' => 'Require "$1" permission',
'protect-level-autoconfirmed' => 'Block unregistered users',
'protect-level-sysop' => 'Sysops only',
'protect-summary-cascade' => 'cascading',