Index: branches/RL2/extensions/Gadgets/SpecialGadgets.php |
— | — | @@ -413,10 +413,19 @@ |
414 | 414 | public function showSingleGadget( Gadget $gadget ) { |
415 | 415 | $this->doSubpageMode(); |
416 | 416 | $out = $this->getOutput(); |
| 417 | + $user = $this->getUser(); |
417 | 418 | |
418 | 419 | $this->setHeaders(); |
419 | 420 | $out->setPagetitle( wfMsg( 'gadgets-gadget-title', $gadget->getTitleMessage() ) ); |
420 | 421 | |
| 422 | + // Only load the gadget manager module if needed |
| 423 | + if ( $user->isAllowed( 'gadgets-definition-delete' ) |
| 424 | + || $user->isAllowed( 'gadgets-definition-edit' ) |
| 425 | + || $user->isAllowed( 'gadgets-definition-create' ) |
| 426 | + ) { |
| 427 | + $out->addModules( 'ext.gadgets.gadgetmanager' ); |
| 428 | + } |
| 429 | + |
421 | 430 | $out->addHTML( '<div class="mw-gadgets-list">' . $this->getGadgetHtml( $gadget ) . '</div>' ); |
422 | 431 | } |
423 | 432 | |