Index: trunk/extensions/WikimediaIncubator/WikimediaIncubator.php |
— | — | @@ -16,7 +16,7 @@ |
17 | 17 | 'path' => __FILE__, |
18 | 18 | 'name' => 'Wikimedia Incubator', |
19 | 19 | 'author' => 'SPQRobin', |
20 | | - 'version' => '4.7', |
| 20 | + 'version' => '4.8', |
21 | 21 | 'url' => '//www.mediawiki.org/wiki/Extension:WikimediaIncubator', |
22 | 22 | 'descriptionmsg' => 'wminc-desc', |
23 | 23 | ); |
Index: trunk/extensions/WikimediaIncubator/SpecialViewUserLang.php |
— | — | @@ -19,7 +19,7 @@ |
20 | 20 | /** |
21 | 21 | * @return String |
22 | 22 | */ |
23 | | - function getDescription() { return wfMsg( 'wminc-viewuserlang' ); } |
| 23 | + function getDescription() { return wfMessage( 'wminc-viewuserlang' )->plain(); } |
24 | 24 | |
25 | 25 | /** |
26 | 26 | * Show the special page |
— | — | @@ -52,13 +52,13 @@ |
53 | 53 | global $wgScript, $wgOut; |
54 | 54 | |
55 | 55 | $wgOut->addHTML( |
56 | | - Xml::fieldset( wfMsgHtml( 'wminc-viewuserlang' ) ) . |
| 56 | + Xml::fieldset( wfMessage( 'wminc-viewuserlang' )->plain() ) . |
57 | 57 | Xml::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript ) ) . |
58 | 58 | Html::hidden( 'title', $this->getTitle()->getPrefixedText() ) . |
59 | 59 | "<p>" . |
60 | | - Xml::inputLabel( wfMsgHtml( 'wminc-viewuserlang-user' ), 'target', 'viewuserlang-username', 40, $target ) . |
| 60 | + Xml::inputLabel( wfMessage( 'wminc-viewuserlang-user' )->text(), 'target', 'viewuserlang-username', 40, $target ) . |
61 | 61 | ' ' . |
62 | | - Xml::submitButton( wfMsgHtml( 'wminc-viewuserlang-go' ) ) . |
| 62 | + Xml::submitButton( wfMessage( 'wminc-viewuserlang-go' )->text() ) . |
63 | 63 | "</p>" . |
64 | 64 | Xml::closeElement( 'form' ) . |
65 | 65 | Xml::closeElement( 'fieldset' ) |
— | — | @@ -73,17 +73,16 @@ |
74 | 74 | global $wgOut, $wmincPref, $wmincProjectSite; |
75 | 75 | if( User::isIP( $target ) ) { |
76 | 76 | # show error if it is an IP address |
77 | | - $wgOut->addHTML( Xml::span( wfMsg( 'wminc-ip', $target ), 'error' ) ); |
| 77 | + $wgOut->addHTML( Xml::span( wfMessage( 'wminc-ip', $target )->text(), 'error' ) ); |
78 | 78 | return; |
79 | 79 | } |
80 | 80 | $user = User::newFromName( $target ); |
81 | 81 | $name = $user->getName(); |
82 | 82 | $id = $user->getId(); |
83 | 83 | $langNames = Language::getLanguageNames(); |
84 | | - $linker = class_exists( 'DummyLinker' ) ? new DummyLinker : new Linker; |
85 | 84 | if ( $user == null || $id == 0 ) { |
86 | 85 | # show error if a user with that name does not exist |
87 | | - $wgOut->addHTML( Xml::span( wfMsg( 'wminc-userdoesnotexist', $target ), 'error' ) ); |
| 86 | + $wgOut->addHTML( Xml::span( wfMessage( 'wminc-userdoesnotexist', $target )->text(), 'error' ) ); |
88 | 87 | return; |
89 | 88 | } |
90 | 89 | $userproject = $user->getOption( $wmincPref . '-project' ); |
— | — | @@ -91,19 +90,19 @@ |
92 | 91 | $usercode = $user->getOption( $wmincPref . '-code' ); |
93 | 92 | $prefix = IncubatorTest::displayPrefix( $userproject, $usercode ? $usercode : 'none' ); |
94 | 93 | if ( IncubatorTest::isContentProject( $userproject ) ) { |
95 | | - $testwiki = $linker->link( Title::newFromText( $prefix ) ); |
| 94 | + $testwiki = Linker::link( Title::newFromText( $prefix ) ); |
96 | 95 | } elseif ( $prefix == $wmincProjectSite['short'] ) { |
97 | 96 | $testwiki = htmlspecialchars( $wmincProjectSite['name'] ); |
98 | 97 | } else { |
99 | | - $testwiki = wfMsgHtml( 'wminc-testwiki-none' ); |
| 98 | + $testwiki = wfMessage( 'wminc-testwiki-none' )->escaped(); |
100 | 99 | } |
101 | 100 | $wgOut->addHtml( |
102 | 101 | Xml::openElement( 'ul' ) . |
103 | | - '<li>' . wfMsgHtml( 'username' ) . ' ' . |
104 | | - $linker->userLink( $id, $name ) . $linker->userToolLinks( $id, $name, true ) . '</li>' . |
105 | | - '<li>' . wfMsgHtml( 'loginlanguagelabel', $langNames[$user->getOption( 'language' )] . |
106 | | - ' (' . $user->getOption( 'language' ) . ')' ) . '</li>' . |
107 | | - '<li>' . wfMsgHtml( 'wminc-testwiki' ) . ' ' . $testwiki . '</li>' . |
| 102 | + '<li>' . wfMessage( 'username' )->escaped() . ' ' . |
| 103 | + Linker::userLink( $id, $name ) . Linker::userToolLinks( $id, $name, true ) . '</li>' . |
| 104 | + '<li>' . wfMessage( 'loginlanguagelabel', $langNames[$user->getOption( 'language' )] . |
| 105 | + ' (' . $user->getOption( 'language' ) . ')' )->escaped() . '</li>' . |
| 106 | + '<li>' . wfMessage( 'wminc-testwiki' )->escaped() . ' ' . $testwiki . '</li>' . |
108 | 107 | Xml::closeElement( 'ul' ) |
109 | 108 | ); |
110 | 109 | } |
Index: trunk/extensions/WikimediaIncubator/ListUsersTestWiki.php |
— | — | @@ -24,7 +24,7 @@ |
25 | 25 | $testwiki = IncubatorTest::getUrlParam(); |
26 | 26 | $project = self::getProjectInput(); |
27 | 27 | $input = $project ? $project['name'] : ( $testwiki ? $testwiki['prefix'] : null ); |
28 | | - $out .= Xml::label( wfMsg( 'wminc-testwiki' ), 'testwiki' ) . ' ' . |
| 28 | + $out .= Xml::label( wfMessage( 'wminc-testwiki' )->text(), 'testwiki' ) . ' ' . |
29 | 29 | Xml::input( 'testwiki', 20, $input, array( 'id' => 'testwiki' ) ) . '<br />'; |
30 | 30 | return true; |
31 | 31 | } |
— | — | @@ -38,12 +38,12 @@ |
39 | 39 | static function onSpecialListusersHeader( $pager, &$out ) { |
40 | 40 | $project = self::getProjectInput(); |
41 | 41 | if( $project ) { |
42 | | - $out .= wfMsgWikiHtml( 'wminc-listusers-testwiki', '"' . $project['name'] . '"' ); |
| 42 | + $out .= wfMessage( 'wminc-listusers-testwiki', '"' . $project['name'] . '"' )->parse(); |
43 | 43 | } else { |
44 | 44 | $testwiki = IncubatorTest::getUrlParam(); |
45 | 45 | if ( $testwiki ) { |
46 | 46 | $link = Linker::linkKnown( Title::newFromText( $testwiki['prefix'] ) ); |
47 | | - $out .= wfMsgWikiHtml( 'wminc-listusers-testwiki', $link ); |
| 47 | + $out .= wfMessage( 'wminc-listusers-testwiki', $link )->parse(); |
48 | 48 | } |
49 | 49 | } |
50 | 50 | return true; |
Index: trunk/extensions/WikimediaIncubator/IncubatorTest.php |
— | — | @@ -26,7 +26,7 @@ |
27 | 27 | $prefinsert[$wmincPref . '-project'] = array( |
28 | 28 | 'type' => 'select', |
29 | 29 | 'options' => |
30 | | - array( wfMsg( 'wminc-testwiki-none' ) => 'none' ) + |
| 30 | + array( wfMessage( 'wminc-testwiki-none' )->plain() => 'none' ) + |
31 | 31 | array_flip( $wmincProjects ) + |
32 | 32 | array( $wmincProjectSite['name'] => $wmincProjectSite['short'] ), |
33 | 33 | 'section' => 'personal/i18n', |
— | — | @@ -66,7 +66,7 @@ |
67 | 67 | array_key_exists( $alldata[$wmincPref.'-project'], $wmincProjects ) && |
68 | 68 | !$input ) { |
69 | 69 | return Xml::element( 'span', array( 'class' => 'error' ), |
70 | | - wfMsg( 'wminc-prefinfo-error' ) ); |
| 70 | + wfMessage( 'wminc-prefinfo-error' )->plain() ); |
71 | 71 | } else { |
72 | 72 | return true; |
73 | 73 | } |
— | — | @@ -358,7 +358,7 @@ |
359 | 359 | static function checkPrefixMovePermissions( $oldtitle, $newtitle, $user, &$error ) { |
360 | 360 | if( self::shouldWeShowUnprefixedError( $newtitle ) ) { |
361 | 361 | # there should be an error with the new page title |
362 | | - $error = wfMsgWikiHtml( 'wminc-error-move-unprefixed' ); |
| 362 | + $error = wfMessage( 'wminc-error-move-unprefixed' )->parse(); |
363 | 363 | return false; |
364 | 364 | } |
365 | 365 | return true; |
— | — | @@ -374,9 +374,9 @@ |
375 | 375 | global $wgUser; |
376 | 376 | if ( $wgUser->isAllowed( 'viewuserlang' ) ) { |
377 | 377 | $user = $nt->getText(); |
378 | | - $links[] = $wgUser->getSkin()->link( |
| 378 | + $links[] = Linker::link( |
379 | 379 | SpecialPage::getTitleFor( 'ViewUserLang', $user ), |
380 | | - wfMsgHtml( 'wminc-viewuserlang' ) |
| 380 | + wfMessage( 'wminc-viewuserlang' )->escaped() |
381 | 381 | ); |
382 | 382 | } |
383 | 383 | return true; |
— | — | @@ -488,7 +488,7 @@ |
489 | 489 | # Show a link to the existing wiki |
490 | 490 | $showLink = self::makeExternalLinkText( $link, true ); |
491 | 491 | $wgOut->addHtml( '<div class="wminc-wiki-exists">' . |
492 | | - wfMsgHtml( 'wminc-error-wiki-exists', $showLink ) . |
| 492 | + wfMessage( 'wminc-error-wiki-exists' )->rawParams( $showLink )->escaped() . |
493 | 493 | '</div>' ); |
494 | 494 | } |
495 | 495 | } elseif( array_key_exists( $p, $wmincSisterProjects ) ) { |
— | — | @@ -497,7 +497,7 @@ |
498 | 498 | ( $title->getNsText() ? $title->getNsText() . ':' : '' ) . $prefix2['realtitle'] ); |
499 | 499 | $showLink = self::makeExternalLinkText( $link, true ); |
500 | 500 | $wgOut->addHtml( '<div class="wminc-wiki-sister">' . |
501 | | - wfMsgHtml( 'wminc-error-wiki-sister', $showLink ) . |
| 501 | + wfMessage( 'wminc-error-wiki-sister' )->rawParams( $showLink )->escaped() . |
502 | 502 | '</div>' ); |
503 | 503 | } elseif ( self::shouldWeShowUnprefixedError( $title ) ) { |
504 | 504 | # Unprefixed pages |
— | — | @@ -508,7 +508,7 @@ |
509 | 509 | $suggest = self::displayPrefixedTitle( $suggesttitle, $title->getNamespace() ); |
510 | 510 | # Suggest to create a prefixed page |
511 | 511 | $wgOut->addHtml( '<div class="wminc-unprefixed-suggest">' . |
512 | | - wfMsgWikiHtml( 'wminc-error-unprefixed-suggest', $suggest ) . |
| 512 | + wfMessage( 'wminc-error-unprefixed-suggest', $suggest )->parseAsBlock() . |
513 | 513 | '</div>' ); |
514 | 514 | } else { |
515 | 515 | $wgOut->addWikiMsg( 'wminc-error-unprefixed' ); |
— | — | @@ -535,7 +535,7 @@ |
536 | 536 | $wgOut->addHtml( $infopage->showMissingWiki() ); |
537 | 537 | } |
538 | 538 | # Set the page title from "Wx/xyz - Incubator" to "Wikiproject Language - Incubator" |
539 | | - $wgOut->setHTMLTitle( wfMsg( 'pagetitle', $infopage->mFormatTitle ) ); |
| 539 | + $wgOut->setHTMLTitle( wfMessage( 'pagetitle', $infopage->mFormatTitle )->text() ); |
540 | 540 | return true; |
541 | 541 | } |
542 | 542 | |
— | — | @@ -591,7 +591,7 @@ |
592 | 592 | */ |
593 | 593 | public static function getMainPage( $langCode, $prefix = null ) { |
594 | 594 | # Take the "mainpage" msg in the given language |
595 | | - $msg = wfMsgExt( 'mainpage', array( 'language' => $langCode ) ); |
| 595 | + $msg = wfMessage( 'mainpage' )->inLanguage( $langCode )->plain(); |
596 | 596 | $mainpage = $prefix !== null ? $prefix . '/' . $msg : $msg; |
597 | 597 | return Title::newFromText( $mainpage ); |
598 | 598 | } |
— | — | @@ -669,14 +669,14 @@ |
670 | 670 | } |
671 | 671 | global $wgLogo; |
672 | 672 | $prefixForPageTitle = str_replace( '/', '-', strtolower( $setLogo['prefix'] ) ); |
673 | | - $file = wfFindFile( wfMsgForContentNoTrans( 'Incubator-logo-' . $prefixForPageTitle ) ); |
| 673 | + $file = wfFindFile( wfMessage( 'Incubator-logo-' . $prefixForPageTitle )->inContentLanguage()->plain() ); |
674 | 674 | if( !$file ) { |
675 | 675 | # if MediaWiki:Incubator-logo-wx-xx(x) doesn't exist, |
676 | 676 | # try a general, default logo for that project |
677 | 677 | global $wmincProjects; |
678 | 678 | $project = $setLogo['project']; |
679 | 679 | $projectForFile = str_replace( ' ', '-', strtolower( $wmincProjects[$project] ) ); |
680 | | - $imageobj = wfFindFile( wfMsg( 'wminc-logo-' . $projectForFile ) ); |
| 680 | + $imageobj = wfFindFile( wfMessage( 'wminc-logo-' . $projectForFile )->plain() ); |
681 | 681 | if( $imageobj ) { |
682 | 682 | $thumb = $imageobj->transform( array( 'width' => 135, 'height' => 135 ) ); |
683 | 683 | $wgLogo = $thumb->getUrl(); |
— | — | @@ -748,7 +748,7 @@ |
749 | 749 | * @return true |
750 | 750 | */ |
751 | 751 | public static function onSpecialSearchPowerBox( &$showSections, $term, $opts ) { |
752 | | - $showSections['testwiki'] = Xml::label( wfMsg( 'wminc-testwiki' ), 'testwiki' ) . ' ' . |
| 752 | + $showSections['testwiki'] = Xml::label( wfMessage( 'wminc-testwiki' )->text(), 'testwiki' ) . ' ' . |
753 | 753 | Xml::input( 'testwiki', 20, self::displayPrefix(), array( 'id' => 'testwiki' ) ); |
754 | 754 | return true; |
755 | 755 | } |
Index: trunk/extensions/WikimediaIncubator/InfoPage.php |
— | — | @@ -60,7 +60,7 @@ |
61 | 61 | */ |
62 | 62 | public function makeLogo( $project, $clickable = true, $width = 25, $height = '', $url = '', $args = array() ) { |
63 | 63 | $projectForFile = preg_replace('/ /', '-', strtolower( $project ) ); |
64 | | - $imageobj = wfFindFile( wfMsg( 'wminc-logo-' . $projectForFile ) ); |
| 64 | + $imageobj = wfFindFile( wfMessage( 'wminc-logo-' . $projectForFile )->plain() ); |
65 | 65 | $useUrl = $url ? $url : IncubatorTest::getSubdomain( 'www', IncubatorTest::getProject( $project, false, true ) ); |
66 | 66 | if ( !$imageobj ) { # image not found |
67 | 67 | if( !$clickable ) { |
— | — | @@ -120,7 +120,7 @@ |
121 | 121 | */ |
122 | 122 | public function showWelcome() { |
123 | 123 | return Html::rawElement( 'div', array( 'class' => 'wminc-infopage-welcome' ), |
124 | | - wfMsgWikiHtml( 'wminc-infopage-welcome' ) ); |
| 124 | + wfMessage( 'wminc-infopage-welcome' )->parseAsBlock() ); |
125 | 125 | } |
126 | 126 | |
127 | 127 | /** |
— | — | @@ -146,21 +146,21 @@ |
147 | 147 | public function showMissingWiki() { |
148 | 148 | $content = Html::rawElement( 'div', |
149 | 149 | array( 'class' => 'wminc-infopage-status' ), |
150 | | - wfMsgWikiHtml( 'wminc-infopage-missingwiki-text', |
151 | | - $this->mProjectName, $this->mLangName ) |
| 150 | + wfMessage( 'wminc-infopage-missingwiki-text', |
| 151 | + $this->mProjectName, $this->mLangName )->parseAsBlock() |
152 | 152 | ) . |
153 | 153 | Html::rawElement( 'ul', array( 'class' => 'wminc-infopage-options' ), |
154 | 154 | Html::rawElement( 'li', null, |
155 | | - wfMsgExt( $this->mIsSister ? 'wminc-infopage-option-startsister' : 'wminc-infopage-option-startwiki', |
156 | | - array( 'parseinline' ), $this->mProjectName, $this->mPortal ) ) . |
| 155 | + wfMessage( $this->mIsSister ? 'wminc-infopage-option-startsister' : 'wminc-infopage-option-startwiki', |
| 156 | + $this->mProjectName, $this->mPortal )->parse() ) . |
157 | 157 | Html::rawElement( 'li', null, |
158 | | - wfMsgExt( 'wminc-infopage-option-languages-existing', |
159 | | - array( 'parseinline' ), $this->mProjectName ) ) . |
| 158 | + wfMessage( 'wminc-infopage-option-languages-existing', |
| 159 | + $this->mProjectName )->parse() ) . |
160 | 160 | Html::rawElement( 'li', null, |
161 | | - wfMsgExt( 'wminc-infopage-option-sisterprojects-existing', |
162 | | - array( 'parseinline' ) ) . $this->listOtherProjects() ) . |
| 161 | + wfMessage( 'wminc-infopage-option-sisterprojects-existing' )->parse() . |
| 162 | + $this->listOtherProjects() ) . |
163 | 163 | Html::rawElement( 'li', null, |
164 | | - wfMsgExt( 'wminc-infopage-option-multilingual', array( 'parseinline' ) ) . |
| 164 | + wfMessage( 'wminc-infopage-option-multilingual' )->parse() . |
165 | 165 | $this->listMultilingualProjects() ) |
166 | 166 | ); |
167 | 167 | return $this->StandardInfoPage( $this->showWelcome(), '', $content ); |
— | — | @@ -179,7 +179,7 @@ |
180 | 180 | if( $this->mThisLangData['type'] != 'invalid' ) { |
181 | 181 | $gotoLink = Linker::link( |
182 | 182 | IncubatorTest::getMainPage( $this->mLangCode, $this->mPrefix ), |
183 | | - wfMsgNoTrans( 'wminc-infopage-enter' ) ); |
| 183 | + wfMessage( 'wminc-infopage-enter' )->plain() ); |
184 | 184 | $gotoMainPage = Html::rawElement( 'span', |
185 | 185 | array( 'class' => 'wminc-infopage-entertest' ), |
186 | 186 | $wgLang->getArrow() . ' ' . ( $this->mIsSister ? $portalLink : $gotoLink ) ); |
— | — | @@ -187,11 +187,11 @@ |
188 | 188 | $subdomain = IncubatorTest::getSubdomain( $this->mLangCode, $this->mProjectCode ); |
189 | 189 | $subdomainLink = IncubatorTest::makeExternalLinkText( $subdomain, true ); |
190 | 190 | $content = Html::rawElement( 'div', array( 'class' => 'wminc-infopage-status' ), |
191 | | - wfMsgWikiHtml( 'wminc-infopage-status-' . $substatus, $subdomainLink, $portalLink ) ); |
| 191 | + wfMessage( 'wminc-infopage-status-' . $substatus )->rawParams( $subdomainLink, $portalLink )->parseAsBlock() ); |
192 | 192 | if( $this->mSubStatus != 'approved' && $this->mThisLangData['type'] != 'invalid' ) { |
193 | 193 | $content .= Html::element( 'div', |
194 | 194 | array( 'class' => 'wminc-infopage-contribute' ), |
195 | | - wfMsg( 'wminc-infopage-contribute' ) ); |
| 195 | + wfMessage( 'wminc-infopage-contribute' )->plain() ); |
196 | 196 | } |
197 | 197 | return $this->StandardInfoPage( '', $gotoMainPage, $content ); |
198 | 198 | } |
— | — | @@ -212,11 +212,11 @@ |
213 | 213 | } |
214 | 214 | $content = Html::rawElement( 'div', |
215 | 215 | array( 'class' => 'wminc-infopage-status' ), |
216 | | - wfMsgWikiHtml( 'wminc-infopage-status-' . $this->mSubStatus, $subdomainLink ) |
| 216 | + wfMessage( 'wminc-infopage-status-' . $this->mSubStatus )->rawParams( $subdomainLink )->parseAsBlock() |
217 | 217 | ) . Html::rawElement( 'ul', array( 'class' => 'wminc-infopage-options' ), |
218 | | - Html::rawElement( 'li', null, wfMsgWikiHtml( 'wminc-infopage-option-sisterprojects-other' ) . |
| 218 | + Html::rawElement( 'li', null, wfMessage( 'wminc-infopage-option-sisterprojects-other' )->parseAsBlock() . |
219 | 219 | $this->listOtherProjects() ) . |
220 | | - Html::rawElement( 'li', null, wfMsgWikiHtml( 'wminc-infopage-option-multilingual' ) . |
| 220 | + Html::rawElement( 'li', null, wfMessage( 'wminc-infopage-option-multilingual' )->parseAsBlock() . |
221 | 221 | $this->listMultilingualProjects() ) |
222 | 222 | ); |
223 | 223 | return $this->StandardInfoPage( $this->showWelcome(), $gotoSubdomain, $content ); |
Index: trunk/extensions/WikimediaIncubator/TestWikiRC.php |
— | — | @@ -51,9 +51,9 @@ |
52 | 52 | list( $projectvalue, $codevalue ) = self::getValues(); |
53 | 53 | $opts->consumeValue( 'rc-testwiki-project' ); |
54 | 54 | $opts->consumeValue( 'rc-testwiki-code' ); |
55 | | - $label = Xml::label( wfMsg( 'wminc-testwiki' ), 'rc-testwiki' ); |
| 55 | + $label = Xml::label( wfMessage( 'wminc-testwiki' )->text(), 'rc-testwiki' ); |
56 | 56 | $select = new XmlSelect( 'rc-testwiki-project', 'rc-testwiki-project', $projectvalue ); |
57 | | - $select->addOption( wfMsg( 'wminc-testwiki-none' ), 'none' ); |
| 57 | + $select->addOption( wfMessage( 'wminc-testwiki-none' )->text(), 'none' ); |
58 | 58 | foreach( $wmincProjects as $prefix => $name ) { |
59 | 59 | $select->addOption( $name, $prefix ); |
60 | 60 | } |