From 588cc40aeec0165400421ef9612e81b6d2c7b936 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Wed, 13 Jun 2012 23:40:19 +0200 Subject: Update to MediaWiki 1.19.1 --- extensions/Gadgets/SpecialGadgets.php | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) (limited to 'extensions/Gadgets/SpecialGadgets.php') diff --git a/extensions/Gadgets/SpecialGadgets.php b/extensions/Gadgets/SpecialGadgets.php index 43bb279f..c9717c0a 100644 --- a/extensions/Gadgets/SpecialGadgets.php +++ b/extensions/Gadgets/SpecialGadgets.php @@ -53,19 +53,17 @@ class SpecialGadgets extends SpecialPage { $listOpen = false; $msgOpt = array( 'parseinline', 'parsemag' ); - $editInterfaceAllowed = $wgUser->isAllowed( 'editinterface' ); + $editInterfaceMessage = $wgUser->isAllowed( 'editinterface' ) + ? 'edit' + : 'viewsource'; foreach ( $gadgets as $section => $entries ) { if ( $section !== false && $section !== '' ) { $t = Title::makeTitleSafe( NS_MEDIAWIKI, "Gadget-section-$section$lang" ); - if ( $editInterfaceAllowed ) { - $lnkTarget = $t - ? Linker::link( $t, wfMsgHTML( 'edit' ), array(), array( 'action' => 'edit' ) ) - : htmlspecialchars( $section ); - $lnk = "    [$lnkTarget]"; - } else { - $lnk = ''; - } + $lnkTarget = $t + ? Linker::link( $t, wfMsgHTML( $editInterfaceMessage ), array(), array( 'action' => 'edit' ) ) + : htmlspecialchars( $section ); + $lnk = "    [$lnkTarget]"; $ttext = wfMsgExt( "gadget-section-$section", $msgOpt ); @@ -88,10 +86,7 @@ class SpecialGadgets extends SpecialPage { } $links = array(); - if ( $editInterfaceAllowed ) { - $links[] = Linker::link( $t, wfMsgHTML( 'edit' ), array(), array( 'action' => 'edit' ) ); - } - + $links[] = Linker::link( $t, wfMsgHTML( $editInterfaceMessage ), array(), array( 'action' => 'edit' ) ); $links[] = Linker::link( $this->getTitle( "export/{$gadget->getName()}" ), wfMsgHtml( 'gadgets-export' ) ); $ttext = wfMsgExt( "gadget-{$gadget->getName()}", $msgOpt ); -- cgit v1.2.2