Merge "Fix edit link for messages in $wgForceUIMsgAsContentMsg"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Sat, 23 May 2015 14:27:19 +0000 (14:27 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Sat, 23 May 2015 14:27:19 +0000 (14:27 +0000)
1  2 
includes/page/Article.php
includes/specials/SpecialBlock.php
includes/specials/SpecialRevisiondelete.php
includes/specials/SpecialUpload.php

@@@ -1505,28 -1505,6 +1505,28 @@@ class Article implements Page 
                        '</div>';
        }
  
 +      /**
 +       * Adds help link with an icon via page indicators.
 +       * Link target can be overridden by a local message containing a wikilink:
 +       * the message key is: 'namespace-' + namespace number + '-helppage'.
 +       * @param string $to Target MediaWiki.org page title or encoded URL.
 +       * @param bool $overrideBaseUrl Whether $url is a full URL, to avoid MW.o.
 +       * @since 1.25
 +       */
 +      public function addHelpLink( $to, $overrideBaseUrl = false ) {
 +              $msg = wfMessage(
 +                      'namespace-' . $this->getTitle()->getNamespace() . '-helppage'
 +              );
 +
 +              $out = $this->getContext()->getOutput();
 +              if ( !$msg->isDisabled() ) {
 +                      $helpUrl = Skin::makeUrl( $msg->plain() );
 +                      $out->addHelpLink( $helpUrl, true );
 +              } else {
 +                      $out->addHelpLink( $to, $overrideBaseUrl );
 +              }
 +      }
 +
        /**
         * Handle action=render
         */
                        Xml::closeElement( 'form' );
  
                        if ( $user->isAllowed( 'editinterface' ) ) {
-                               $dropdownTitle = Title::makeTitle( NS_MEDIAWIKI, 'Deletereason-dropdown' );
                                $link = Linker::link(
-                                       $dropdownTitle,
+                                       $ctx->msg( 'deletereason-dropdown' )->inContentLanguage()->getTitle(),
                                        wfMessage( 'delete-edit-reasonlist' )->escaped(),
                                        array(),
                                        array( 'action' => 'edit' )
@@@ -103,7 -103,7 +103,7 @@@ class SpecialBlock extends FormSpecialP
                $msg = $this->alreadyBlocked ? 'ipb-change-block' : 'ipbsubmit';
                $form->setSubmitTextMsg( $msg );
  
 -              $this->getOutput()->addHelpLink( 'Help:Blocking users' );
 +              $this->addHelpLink( 'Help:Blocking users' );
  
                # Don't need to do anything if the form has been posted
                if ( !$this->getRequest()->wasPosted() && $this->preErrors ) {
                # Link to edit the block dropdown reasons, if applicable
                if ( $user->isAllowed( 'editinterface' ) ) {
                        $links[] = Linker::link(
-                               Title::makeTitle( NS_MEDIAWIKI, 'Ipbreason-dropdown' ),
+                               $this->msg( 'ipbreason-dropdown' )->inContentLanguage()->getTitle(),
                                $this->msg( 'ipb-edit-dropdown' )->escaped(),
                                array(),
                                array( 'action' => 'edit' )
@@@ -368,7 -368,7 +368,7 @@@ class SpecialRevisionDelete extends Unl
                $out->wrapWikiMsg( "<strong>$1</strong>", array( $this->typeLabels['selected'],
                        $this->getLanguage()->formatNum( count( $this->ids ) ), $this->targetObj->getPrefixedText() ) );
  
 -              $out->addHelpLink( 'Help:RevisionDelete' );
 +              $this->addHelpLink( 'Help:RevisionDelete' );
                $out->addHTML( "<ul>" );
  
                $numRevisions = 0;
                                Xml::closeElement( 'form' ) . "\n";
                        // Show link to edit the dropdown reasons
                        if ( $this->getUser()->isAllowed( 'editinterface' ) ) {
-                               $title = Title::makeTitle( NS_MEDIAWIKI, 'Revdelete-reason-dropdown' );
                                $link = Linker::link(
-                                       $title,
+                                       $this->msg( 'revdelete-reason-dropdown' )->inContentLanguage()->getTitle(),
                                        $this->msg( 'revdelete-edit-reasonlist' )->escaped(),
                                        array(),
                                        array( 'action' => 'edit' )
@@@ -160,7 -160,7 +160,7 @@@ class SpecialUpload extends SpecialPag
                        throw new ErrorPageError( 'uploaddisabled', 'uploaddisabledtext' );
                }
  
 -              $this->getOutput()->addHelpLink( 'Help:Managing files' );
 +              $this->addHelpLink( 'Help:Managing files' );
  
                # Check permissions
                $user = $this->getUser();
@@@ -818,7 -818,7 +818,7 @@@ class UploadForm extends HTMLForm 
                # Add a link to edit MediaWik:Licenses
                if ( $this->getUser()->isAllowed( 'editinterface' ) ) {
                        $licensesLink = Linker::link(
-                               Title::makeTitle( NS_MEDIAWIKI, 'Licenses' ),
+                               $this->msg( 'licenses' )->inContentLanguage()->getTitle(),
                                $this->msg( 'licenses-edit' )->escaped(),
                                array(),
                                array( 'action' => 'edit' )