Merge "Use PHP's implode() with the suggested order of arguments"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Thu, 22 Feb 2018 20:04:00 +0000 (20:04 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Thu, 22 Feb 2018 20:04:00 +0000 (20:04 +0000)
1  2 
includes/EditPage.php

diff --combined includes/EditPage.php
@@@ -239,19 -239,19 +239,19 @@@ class EditPage 
        public $isConflict = false;
  
        /**
 -       * @deprecated since 1.30 use Title::isCssJsSubpage()
 +       * @deprecated since 1.30 use Title::isUserConfigPage()
         * @var bool
         */
        public $isCssJsSubpage = false;
  
        /**
 -       * @deprecated since 1.30 use Title::isCssSubpage()
 +       * @deprecated since 1.30 use Title::isUserCssConfigPage()
         * @var bool
         */
        public $isCssSubpage = false;
  
        /**
 -       * @deprecated since 1.30 use Title::isJsSubpage()
 +       * @deprecated since 1.30 use Title::isUserJsConfigPage()
         * @var bool
         */
        public $isJsSubpage = false;
                // css / js subpages of user pages get a special treatment
                // The following member variables are deprecated since 1.30,
                // the functions should be used instead.
 -              $this->isCssJsSubpage = $this->mTitle->isCssJsSubpage();
 -              $this->isCssSubpage = $this->mTitle->isCssSubpage();
 -              $this->isJsSubpage = $this->mTitle->isJsSubpage();
 -              $this->isWrongCaseCssJsPage = $this->isWrongCaseCssJsPage();
 +              $this->isCssJsSubpage = $this->mTitle->isUserConfigPage();
 +              $this->isCssSubpage = $this->mTitle->isUserCssConfigPage();
 +              $this->isJsSubpage = $this->mTitle->isUserJsConfigPage();
 +              $this->isWrongCaseCssJsPage = $this->isWrongCaseUserConfigPage();
  
                # Show applicable editing introductions
                if ( $this->formtype == 'initial' || $this->firsttime ) {
         *
         * @return bool
         */
 -      protected function isWrongCaseCssJsPage() {
 -              if ( $this->mTitle->isCssJsSubpage() ) {
 -                      $name = $this->mTitle->getSkinFromCssJsSubpage();
 +      protected function isWrongCaseUserConfigPage() {
 +              if ( $this->mTitle->isUserConfigPage() ) {
 +                      $name = $this->mTitle->getSkinFromConfigSubpage();
                        $skins = array_merge(
                                array_keys( Skin::getSkinNames() ),
                                [ 'common' ]
@@@ -2879,7 -2879,7 +2879,7 @@@ ERROR
                        $out->addHTML( $editConflictHelper->getEditFormHtmlBeforeContent() );
                }
  
 -              if ( !$this->mTitle->isCssJsSubpage() && $showToolbar && $user->getOption( 'showtoolbar' ) ) {
 +              if ( !$this->mTitle->isUserConfigPage() && $showToolbar && $user->getOption( 'showtoolbar' ) ) {
                        $out->addHTML( self::getEditToolbar( $this->mTitle ) );
                }
  
                                );
                        }
                } else {
 -                      if ( $this->mTitle->isCssJsSubpage() ) {
 +                      if ( $this->mTitle->isUserConfigPage() ) {
                                # Check the skin exists
 -                              if ( $this->isWrongCaseCssJsPage() ) {
 +                              if ( $this->isWrongCaseUserConfigPage() ) {
                                        $out->wrapWikiMsg(
 -                                              "<div class='error' id='mw-userinvalidcssjstitle'>\n$1\n</div>",
 -                                              [ 'userinvalidcssjstitle', $this->mTitle->getSkinFromCssJsSubpage() ]
 +                                              "<div class='error' id='mw-userinvalidconfigtitle'>\n$1\n</div>",
 +                                              [ 'userinvalidconfigtitle', $this->mTitle->getSkinFromConfigSubpage() ]
                                        );
                                }
                                if ( $this->getTitle()->isSubpageOf( $user->getUserPage() ) ) {
 -                                      $isCssSubpage = $this->mTitle->isCssSubpage();
 -                                      $out->wrapWikiMsg( '<div class="mw-usercssjspublic">$1</div>',
 -                                              $isCssSubpage ? 'usercssispublic' : 'userjsispublic'
 -                                      );
 +                                      $isUserCssConfig = $this->mTitle->isUserCssConfigPage();
 +
 +                                      $warning = $isUserCssConfig
 +                                              ? 'usercssispublic'
 +                                              : 'userjsispublic';
 +
 +                                      $out->wrapWikiMsg( '<div class="mw-userconfigpublic">$1</div>', $warning );
 +
                                        if ( $this->formtype !== 'preview' ) {
                                                $config = $this->context->getConfig();
 -                                              if ( $isCssSubpage && $config->get( 'AllowUserCss' ) ) {
 +                                              if ( $isUserCssConfig && $config->get( 'AllowUserCss' ) ) {
                                                        $out->wrapWikiMsg(
                                                                "<div id='mw-usercssyoucanpreview'>\n$1\n</div>",
                                                                [ 'usercssyoucanpreview' ]
                $out->addHTML( $this->editFormTextAfterWarn );
  
                $out->addHTML( "<div class='editButtons'>\n" );
-               $out->addHTML( implode( $this->getEditButtons( $tabindex ), "\n" ) . "\n" );
+               $out->addHTML( implode( "\n", $this->getEditButtons( $tabindex ) ) . "\n" );
  
                $cancel = $this->getCancelLink();
  
                        }
  
                        # don't parse non-wikitext pages, show message about preview
 -                      if ( $this->mTitle->isCssJsSubpage() || $this->mTitle->isCssOrJsPage() ) {
 -                              if ( $this->mTitle->isCssJsSubpage() ) {
 +                      if ( $this->mTitle->isUserConfigPage() || $this->mTitle->isSiteConfigPage() ) {
 +                              if ( $this->mTitle->isUserConfigPage() ) {
                                        $level = 'user';
 -                              } elseif ( $this->mTitle->isCssOrJsPage() ) {
 +                              } elseif ( $this->mTitle->isSiteConfigPage() ) {
                                        $level = 'site';
                                } else {
                                        $level = false;