Index: trunk/extensions/WikimediaIncubator/WikimediaIncubator.php |
— | — | @@ -17,7 +17,7 @@ |
18 | 18 | 'name' => 'Wikimedia Incubator', |
19 | 19 | 'author' => 'SPQRobin', |
20 | 20 | 'version' => '4.8', |
21 | | - 'url' => '//www.mediawiki.org/wiki/Extension:WikimediaIncubator', |
| 21 | + 'url' => 'https://www.mediawiki.org/wiki/Extension:WikimediaIncubator', |
22 | 22 | 'descriptionmsg' => 'wminc-desc', |
23 | 23 | ); |
24 | 24 | |
Index: trunk/extensions/WikimediaIncubator/IncubatorTest.php |
— | — | @@ -67,9 +67,8 @@ |
68 | 68 | !$input ) { |
69 | 69 | return Xml::element( 'span', array( 'class' => 'error' ), |
70 | 70 | wfMessage( 'wminc-prefinfo-error' )->plain() ); |
71 | | - } else { |
72 | | - return true; |
73 | 71 | } |
| 72 | + return true; |
74 | 73 | } |
75 | 74 | |
76 | 75 | /** |
— | — | @@ -269,11 +268,8 @@ |
270 | 269 | } |
271 | 270 | |
272 | 271 | static function magicWordValue( &$parser, &$cache, &$magicWordId, &$ret ) { |
273 | | - if( !self::displayPrefix() ) { |
274 | | - $ret = 'none'; |
275 | | - } else { |
276 | | - $ret = self::displayPrefix(); |
277 | | - } |
| 272 | + $p = self::displayPrefix(); |
| 273 | + $ret = $p ? $p : 'none'; |
278 | 274 | return true; |
279 | 275 | } |
280 | 276 | |
— | — | @@ -331,7 +327,7 @@ |
332 | 328 | return $action != 'edit'; |
333 | 329 | } |
334 | 330 | |
335 | | - if( !self::shouldWeShowUnprefixedError( $title ) || $action != 'create' ) { |
| 331 | + if( !self::shouldWeShowUnprefixedError( $title ) || $action != 'edit' || $title->exists() ) { |
336 | 332 | # only check if needed & if on page creation |
337 | 333 | return true; |
338 | 334 | } elseif( $prefixdata['error'] == 'invalidlangcode' ) { |
— | — | @@ -374,7 +370,7 @@ |
375 | 371 | global $wgUser; |
376 | 372 | if ( $wgUser->isAllowed( 'viewuserlang' ) ) { |
377 | 373 | $user = $nt->getText(); |
378 | | - $links[] = Linker::link( |
| 374 | + $links[] = Linker::linkKnown( |
379 | 375 | SpecialPage::getTitleFor( 'ViewUserLang', $user ), |
380 | 376 | wfMessage( 'wminc-viewuserlang' )->escaped() |
381 | 377 | ); |
— | — | @@ -383,16 +379,6 @@ |
384 | 380 | } |
385 | 381 | |
386 | 382 | /** |
387 | | - * This loads language names. Also from CLDR if that extension is found. |
388 | | - * @return Array with language names |
389 | | - */ |
390 | | - static public function getLanguageNames( $code = null ) { |
391 | | - global $wgLang; |
392 | | - $langcode = ( $code ? $code : $wgLang->getCode() ); |
393 | | - return Language::getTranslatedLanguageNames( $langcode ); |
394 | | - } |
395 | | - |
396 | | - /** |
397 | 383 | * Do we know the databases of the existing wikis? |
398 | 384 | * @return Boolean |
399 | 385 | */ |
Index: trunk/extensions/WikimediaIncubator/InfoPage.php |
— | — | @@ -25,7 +25,7 @@ |
26 | 26 | * @param $prefixdata |
27 | 27 | */ |
28 | 28 | public function __construct( $title, $prefixdata ) { |
29 | | - global $wmincProjects, $wmincSisterProjects; |
| 29 | + global $wmincProjects, $wmincSisterProjects, $wgLang; |
30 | 30 | $this->mTitle = $title; |
31 | 31 | $this->mPrefix = $prefixdata['prefix']; |
32 | 32 | $this->mLangCode = $prefixdata['lang']; |
— | — | @@ -41,7 +41,7 @@ |
42 | 42 | $this->mDBStatus = ''; |
43 | 43 | $this->mSubStatus = ''; |
44 | 44 | $this->mThisLangData = array( 'type' => 'valid' ); # For later code check feature |
45 | | - $this->mLangNames = IncubatorTest::getLanguageNames(); |
| 45 | + $this->mLangNames = Language::getTranslatedLanguageNames( $wgLang->getCode() ); |
46 | 46 | $this->mLangName = isset( $this->mLangNames[$this->mLangCode] ) ? |
47 | 47 | $this->mLangNames[$this->mLangCode] : null; |
48 | 48 | $titleParam = $this->mLangName ? $this->mLangName : '"' . $this->mLangCode . '"'; # Name, else code |