public function showList( $msg = '' ) {
global $wgOut, $wgRequest;
- if( "" != $msg ) {
+ if( $msg != "" ) {
$wgOut->setSubtitle( $msg );
}
# Show a link to the change protection form for allowed users otherwise a link to the protection log
if( $wgUser->isAllowed( 'protect' ) ) {
- $changeProtection = ' (' . $skin->makeKnownLinkObj( $title, wfMsgHtml( 'protect_change' ),
- 'action=unprotect' ) . ')';
+ $changeProtection = ' (' . $skin->linkKnown(
+ $title,
+ wfMsgHtml( 'protect_change' ),
+ array(),
+ array( 'action' => 'unprotect' )
+ ) . ')';
} else {
$ltitle = SpecialPage::getTitleFor( 'Log' );
- $changeProtection = ' (' . $skin->makeKnownLinkObj( $ltitle, wfMsgHtml( 'protectlogpage' ),
- 'type=protect&page=' . $title->getPrefixedUrl() ) . ')';
+ $changeProtection = ' (' . $skin->linkKnown(
+ $ltitle,
+ wfMsgHtml( 'protectlogpage' ),
+ array(),
+ array(
+ 'type' => 'protect',
+ 'page' => $title->getPrefixedText()
+ )
+ ) . ')';
}
wfProfileOut( __METHOD__ );
- return '<li>' . wfSpecialList( $link . $stxt, implode( $description_items, ', ' ) ) . $changeProtection . "</li>\n";
+ return Html::rawElement(
+ 'li',
+ array(),
+ wfSpecialList( $link . $stxt, $wgLang->commaList( $description_items ) ) . $changeProtection ) . "\n";
}
/**
- * @param $namespace int
- * @param $type string
- * @param $level string
- * @param $minsize int
- * @param $indefOnly bool
- * @param $cascadeOnly bool
- * @return string Input form
- * @private
+ * @param $namespace Integer
+ * @param $type String: restriction type
+ * @param $level String: restriction level
+ * @param $sizetype String: "min" or "max"
+ * @param $size Integer
+ * @param $indefOnly Boolean: only indefinie protection
+ * @param $cascadeOnly Boolean: only cascading protection
+ * @return String: input form
*/
protected function showOptions( $namespace, $type='edit', $level, $sizetype, $size, $indefOnly, $cascadeOnly ) {
global $wgScript;
- $title = SpecialPage::getTitleFor( 'ProtectedPages' );
+ $title = SpecialPage::getTitleFor( 'Protectedpages' );
return Xml::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript ) ) .
Xml::openElement( 'fieldset' ) .
Xml::element( 'legend', array(), wfMsg( 'protectedpages' ) ) .
$this->getNamespaceMenu( $namespace ) . " \n" .
$this->getTypeMenu( $type ) . " \n" .
$this->getLevelMenu( $level ) . " \n" .
- "<br/><span style='white-space: nowrap'>" .
+ "<br /><span style='white-space: nowrap'>" .
$this->getExpiryCheck( $indefOnly ) . " \n" .
$this->getCascadeCheck( $cascadeOnly ) . " \n" .
- "</span><br/><span style='white-space: nowrap'>" .
+ "</span><br /><span style='white-space: nowrap'>" .
$this->getSizeLimit( $sizetype, $size ) . " \n" .
"</span>" .
" " . Xml::submitButton( wfMsg( 'allpagessubmit' ) ) . "\n" .
* Prepare the namespace filter drop-down; standard namespace
* selector, sans the MediaWiki namespace
*
- * @param mixed $namespace Pre-select namespace
- * @return string
+ * @param $namespace Mixed: pre-select namespace
+ * @return String
*/
protected function getNamespaceMenu( $namespace = null ) {
return "<span style='white-space: nowrap'>" .
}
/**
+ * Creates the input label of the restriction type
+ * @param $pr_type string Protection type
* @return string Formatted HTML
*/
protected function getTypeMenu( $pr_type ) {
}
/**
+ * Creates the input label of the restriction level
+ * @param $pr_level string Protection level
* @return string Formatted HTML
*/
protected function getLevelMenu( $pr_level ) {
// First pass to load the log names
foreach( $wgRestrictionLevels as $type ) {
+ // Messages used can be 'restriction-level-sysop' and 'restriction-level-autoconfirmed'
if( $type !='' && $type !='*') {
$text = wfMsg("restriction-level-$type");
$m[$text] = $type;
$options[] = Xml::option( $text, $type, $selected );
}
- return
- Xml::label( wfMsg('restriction-level') , $this->IdLevel ) . ' ' .
+ return "<span style='white-space: nowrap'>" .
+ Xml::label( wfMsg( 'restriction-level' ) , $this->IdLevel ) . ' ' .
Xml::tags( 'select',
array( 'id' => $this->IdLevel, 'name' => $this->IdLevel ),
- implode( "\n", $options ) );
+ implode( "\n", $options ) ) . "</span>";
}
}