jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/402422 )

Change subject: Remove Special:MobileOptions/Languages
......................................................................


Remove Special:MobileOptions/Languages

This was added back in 2012
In the old version of the language overlay when a language
did not exist we linked to this page. We don't do that anymore
since the new language overlay we launched in August 2016.

It's not linked to anywhere in the UI.

Should probably remove as it caused me a big surprise to not only
see it existed but to see I wrote the code haha

Change-Id: I9c7cca88c4f3df42f2ced93b72011f18d911acce
---
M i18n/en.json
M i18n/qqq.json
M includes/specials/SpecialMobileOptions.php
3 files changed, 3 insertions(+), 87 deletions(-)

Approvals:
  Pmiazga: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/i18n/en.json b/i18n/en.json
index 9217300..6f28ee9 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -196,12 +196,9 @@
        "mobile-frontend-save-error": "Error saving settings. Please make sure 
that you have cookies enabled.",
        "mobile-frontend-save-settings": "Save",
        "mobile-frontend-search-content": "Search within pages",
-       "mobile-frontend-search-content-no-results": 
"'''{{int:mobile-frontend-search-content}}''' to see if this phrase appears 
anywhere.",
        "mobile-frontend-search-no-results": "No page with this title.",
        "mobile-frontend-settings-tagline": "Reading preferences",
        "mobile-frontend-settings-beta": "{{SITENAME}} βeta",
-       "mobile-frontend-settings-site-description": "{{SITENAME}} is available 
in $1 {{PLURAL:$1|language|languages}}. All available versions are listed 
below",
-       "mobile-frontend-settings-site-header": "{{SITENAME}} Languages",
        "mobile-frontend-settings-save": "Settings were saved successfully.",
        "mobile-frontend-talk-fullpage": "Read as wiki page",
        "mobile-frontend-talk-add-overlay-content-placeholder": "What is on 
your mind?",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 91f2348..7042381 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -197,12 +197,9 @@
        "mobile-frontend-save-error": "Error message shown when a user tries to 
save settings form without cookies present.",
        "mobile-frontend-save-settings": "Text for button for saving settings 
on [[Special:MobileOptions]]. Since this appears on the settings page 
translating the word save is sufficient\n{{Identical|Save}}",
        "mobile-frontend-search-content": "Caption for a button performing full 
text search of a given search query.\n\nUsed in 
{{msg-mw|Mobile-frontend-search-content-no-results}}.",
-       "mobile-frontend-search-content-no-results": "Used when no pages with 
matching titles were found.\n\nRefers to 
{{msg-mw|Mobile-frontend-search-content}}.",
        "mobile-frontend-search-no-results": "Message informing user that no 
pages were found for a given query.",
        "mobile-frontend-settings-tagline": "Tagline for Special:MobileOptions 
- will show under heading",
        "mobile-frontend-settings-beta": "Text for beta on settings 
page.\n{{Identical|Beta}}",
-       "mobile-frontend-settings-site-description": "Shown on 
[[Special:MobileOptions]]. Parameters:\n* $1 - the number of other language 
versions for this wiki",
-       "mobile-frontend-settings-site-header": "Heading for the 
Special:MobileOptions/Language page - only visible to non JavaScript users",
        "mobile-frontend-settings-save": "Notification which shows to user when 
settings are saved.",
        "mobile-frontend-talk-fullpage": "Used as label for link to the talk 
page (Talk:ArticleName) in Talk Overlay.",
        "mobile-frontend-talk-add-overlay-content-placeholder": "Placeholder 
text to prompt user to add content to talk page content",
diff --git a/includes/specials/SpecialMobileOptions.php 
b/includes/specials/SpecialMobileOptions.php
index a00e0b4..d3603c0 100644
--- a/includes/specials/SpecialMobileOptions.php
+++ b/includes/specials/SpecialMobileOptions.php
@@ -8,11 +8,6 @@
        private $returnToTitle;
        /** @var boolean $hasDesktopVersion Whether this special page has a 
desktop version or not */
        protected $hasDesktopVersion = true;
-       /** @var array $options Used in the execute() function as a map of 
subpages to
-        functions that are executed when the request method is defined. */
-       private $options = [
-               'Language' => [ 'get' => 'chooseLanguage' ],
-       ];
 
        /**
         * Construct function
@@ -44,24 +39,11 @@
                $this->setHeaders();
                $context->setForceMobileView( true );
                $context->setContentTransformations( false );
-               // check, if the subpage has a registered function, that needs 
to be executed
-               if ( isset( $this->options[$par] ) ) {
-                       $option = $this->options[$par];
 
-                       // select the correct function for the given request 
method (post, get)
-                       if ( $this->getRequest()->wasPosted() && isset( 
$option['post'] ) ) {
-                               $func = $option['post'];
-                       } else {
-                               $func = $option['get'];
-                       }
-                       // run the function
-                       $this->$func();
+               if ( $this->getRequest()->wasPosted() ) {
+                       $this->submitSettingsForm();
                } else {
-                       if ( $this->getRequest()->wasPosted() ) {
-                               $this->submitSettingsForm();
-                       } else {
-                               $this->addSettingsForm();
-                       }
+                       $this->addSettingsForm();
                }
        }
 
@@ -192,59 +174,6 @@
        }
 
        /**
-        * Get a list of languages available for this project
-        * @return string parsed Html
-        */
-       private function getSiteSelector() {
-               $selector = '';
-               $count = 0;
-               $language = $this->getLanguage();
-               $interwikiLookup = 
\MediaWiki\MediaWikiServices::getInstance()->getInterwikiLookup();
-               foreach ( $interwikiLookup->getAllPrefixes( true ) as 
$interwiki ) {
-                       $code = $interwiki['iw_prefix'];
-                       $name = Language::fetchLanguageName( $code, 
$language->getCode() );
-                       if ( !$name ) {
-                               continue;
-                       }
-                       $title = Title::newFromText( "$code:" );
-                       if ( $title ) {
-                               $url = $title->getFullURL();
-                       } else {
-                               $url = '';
-                       }
-                       $attrs = [ 'href' => $url ];
-                       $count++;
-                       if ( $code == $this->getConfig()->get( 'LanguageCode' ) 
) {
-                               $attrs['class'] = 'selected';
-                       }
-                       $selector .= Html::openElement( 'li' );
-                       $selector .= Html::element( 'a', $attrs, $name );
-                       $selector .= Html::closeElement( 'li' );
-               }
-
-               if ( $selector && $count > 1 ) {
-                       $selector = <<<HTML
-                       <p>{$this->msg( 
'mobile-frontend-settings-site-description', $count )->parse()}</p>
-                       <ul id='mw-mf-language-list'>
-                               {$selector}
-                       </ul>
-HTML;
-               }
-
-               return $selector;
-       }
-
-       /**
-        * Render the language selector special page, callable through 
Special:MobileOptions/Language
-        * See the $options member variable of this class.
-        */
-       private function chooseLanguage() {
-               $out = $this->getOutput();
-               $out->setPageTitle( $this->msg( 
'mobile-frontend-settings-site-header' )->escaped() );
-               $out->addHTML( $this->getSiteSelector() );
-       }
-
-       /**
         * Saves the settings submitted by the settings form
         */
        private function submitSettingsForm() {
@@ -288,12 +217,5 @@
                $context->setMobileMode( $group );
                $url = $this->getPageTitle()->getFullURL( 'success' );
                $context->getOutput()->redirect( 
MobileContext::singleton()->getMobileUrl( $url ) );
-       }
-
-       /**
-        * @return string[]
-        */
-       public function getSubpagesForPrefixSearch() {
-               return array_keys( $this->options );
        }
 }

-- 
To view, visit https://gerrit.wikimedia.org/r/402422
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I9c7cca88c4f3df42f2ced93b72011f18d911acce
Gerrit-PatchSet: 10
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: specialpages
Gerrit-Owner: Jdlrobson <jrob...@wikimedia.org>
Gerrit-Reviewer: Jdlrobson <jrob...@wikimedia.org>
Gerrit-Reviewer: Pmiazga <pmia...@wikimedia.org>
Gerrit-Reviewer: Siebrand <siebr...@kitano.nl>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to