Index: trunk/phase3/includes/SkinTemplate.php |
— | — | @@ -324,6 +324,7 @@ |
325 | 325 | $out->setSquidMaxage( 0 ); |
326 | 326 | } |
327 | 327 | } else if( count( $newtalks ) ) { |
| 328 | + // _>" " for BC <= 1.16 |
328 | 329 | $sep = str_replace( '_', ' ', wfMsgHtml( 'newtalkseparator' ) ); |
329 | 330 | $msgs = array(); |
330 | 331 | foreach( $newtalks as $newtalk ) { |
Index: trunk/phase3/includes/specials/SpecialListUserRestrictions.php |
— | — | @@ -0,0 +1,164 @@ |
| 2 | +<?php |
| 3 | + |
| 4 | +function wfSpecialListUserRestrictions() { |
| 5 | + global $wgOut, $wgRequest; |
| 6 | + |
| 7 | + $wgOut->addWikiMsg( 'listuserrestrictions-intro' ); |
| 8 | + $f = new SpecialListUserRestrictionsForm(); |
| 9 | + $wgOut->addHTML( $f->getHTML() ); |
| 10 | + |
| 11 | + if( !mt_rand( 0, 10 ) ) |
| 12 | + UserRestriction::purgeExpired(); |
| 13 | + $pager = new UserRestrictionsPager( $f->getConds() ); |
| 14 | + if( $pager->getNumRows() ) |
| 15 | + $wgOut->addHTML( $pager->getNavigationBar() . |
| 16 | + Xml::tags( 'ul', null, $pager->getBody() ) . |
| 17 | + $pager->getNavigationBar() |
| 18 | + ); |
| 19 | + elseif( $f->getConds() ) |
| 20 | + $wgOut->addWikiMsg( 'listuserrestrictions-notfound' ); |
| 21 | + else |
| 22 | + $wgOut->addWikiMsg( 'listuserrestrictions-empty' ); |
| 23 | +} |
| 24 | + |
| 25 | +class SpecialListUserRestrictionsForm { |
| 26 | + public function getHTML() { |
| 27 | + global $wgRequest, $wgScript; |
| 28 | + $action = htmlspecialchars( $wgScript ); |
| 29 | + $s = ''; |
| 30 | + $s .= Xml::fieldset( wfMsg( 'listuserrestrictions-legend' ) ); |
| 31 | + $s .= "<form action=\"{$action}\">"; |
| 32 | + $s .= Xml::hidden( 'title', SpecialPage::getTitleFor('ListUserRestrictions')->getPrefixedDbKey() ); |
| 33 | + $s .= Xml::label( wfMsg( 'listuserrestrictions-type' ), 'type' ) . ' ' . |
| 34 | + self::typeSelector( 'type', $wgRequest->getVal( 'type' ), 'type' ); |
| 35 | + $s .= ' '; |
| 36 | + $s .= Xml::inputLabel( wfMsg( 'listuserrestrictions-user' ), 'user', 'user', |
| 37 | + false, $wgRequest->getVal( 'user' ) ); |
| 38 | + $s .= '<p>'; |
| 39 | + $s .= Xml::label( wfMsg( 'listuserrestrictions-namespace' ), 'namespace' ) . ' ' . |
| 40 | + Xml::namespaceSelector( $wgRequest->getVal( 'namespace' ), '', 'namespace' ); |
| 41 | + $s .= ' '; |
| 42 | + $s .= Xml::inputLabel( wfMsg( 'listuserrestrictions-page' ), 'page', 'page', |
| 43 | + false, $wgRequest->getVal( 'page' ) ); |
| 44 | + $s .= Xml::submitButton( wfMsg( 'listuserrestrictions-submit' ) ); |
| 45 | + $s .= "</p></form></fieldset>"; |
| 46 | + return $s; |
| 47 | + } |
| 48 | + |
| 49 | + public static function typeSelector( $name = 'type', $value = '', $id = false ) { |
| 50 | + $s = new XmlSelect( $name, $id, $value ); |
| 51 | + $s->addOption( wfMsg( 'userrestrictiontype-none' ), '' ); |
| 52 | + $s->addOption( wfMsg( 'userrestrictiontype-page' ), UserRestriction::PAGE ); |
| 53 | + $s->addOption( wfMsg( 'userrestrictiontype-namespace' ), UserRestriction::NAMESPACE ); |
| 54 | + return $s->getHTML(); |
| 55 | + } |
| 56 | + |
| 57 | + public function getConds() { |
| 58 | + global $wgRequest; |
| 59 | + $conds = array(); |
| 60 | + |
| 61 | + $type = $wgRequest->getVal( 'type' ); |
| 62 | + if( in_array( $type, array( UserRestriction::PAGE, UserRestriction::NAMESPACE ) ) ) |
| 63 | + $conds['ur_type'] = $type; |
| 64 | + |
| 65 | + $user = $wgRequest->getVal( 'user' ); |
| 66 | + if( $user ) |
| 67 | + $conds['ur_user_text'] = $user; |
| 68 | + |
| 69 | + $namespace = $wgRequest->getVal( 'namespace' ); |
| 70 | + if( $namespace || $namespace === '0' ) |
| 71 | + $conds['ur_namespace'] = $namespace; |
| 72 | + |
| 73 | + $page = $wgRequest->getVal( 'page' ); |
| 74 | + $title = Title::newFromText( $page ); |
| 75 | + if( $title ) { |
| 76 | + $conds['ur_page_namespace'] = $title->getNamespace(); |
| 77 | + $conds['ur_page_title'] = $title->getDBkey(); |
| 78 | + } |
| 79 | + |
| 80 | + return $conds; |
| 81 | + } |
| 82 | +} |
| 83 | + |
| 84 | +class UserRestrictionsPager extends ReverseChronologicalPager { |
| 85 | + public $mConds; |
| 86 | + |
| 87 | + public function __construct( $conds = array() ) { |
| 88 | + $this->mConds = $conds; |
| 89 | + parent::__construct(); |
| 90 | + } |
| 91 | + |
| 92 | + public function getStartBody() { |
| 93 | + # Copied from Special:Ipblocklist |
| 94 | + wfProfileIn( __METHOD__ ); |
| 95 | + # Do a link batch query |
| 96 | + $this->mResult->seek( 0 ); |
| 97 | + $lb = new LinkBatch; |
| 98 | + |
| 99 | + # Faster way |
| 100 | + # Usernames and titles are in fact related by a simple substitution of space -> underscore |
| 101 | + # The last few lines of Title::secureAndSplit() tell the story. |
| 102 | + foreach( $this->mResult as $row ) { |
| 103 | + $name = str_replace( ' ', '_', $row->ur_by_text ); |
| 104 | + $lb->add( NS_USER, $name ); |
| 105 | + $lb->add( NS_USER_TALK, $name ); |
| 106 | + $name = str_replace( ' ', '_', $row->ur_user_text ); |
| 107 | + $lb->add( NS_USER, $name ); |
| 108 | + $lb->add( NS_USER_TALK, $name ); |
| 109 | + if( $row->ur_type == UserRestriction::PAGE ) |
| 110 | + $lb->add( $row->ur_page_namespace, $row->ur_page_title ); |
| 111 | + } |
| 112 | + $lb->execute(); |
| 113 | + wfProfileOut( __METHOD__ ); |
| 114 | + return ''; |
| 115 | + } |
| 116 | + |
| 117 | + public function getQueryInfo() { |
| 118 | + return array( |
| 119 | + 'tables' => 'user_restrictions', |
| 120 | + 'fields' => '*', |
| 121 | + 'conds' => $this->mConds, |
| 122 | + ); |
| 123 | + } |
| 124 | + |
| 125 | + public function formatRow( $row ) { |
| 126 | + return self::formatRestriction( UserRestriction::newFromRow( $row ) ); |
| 127 | + } |
| 128 | + |
| 129 | + // Split off for use on Special:RestrictUser |
| 130 | + public static function formatRestriction( $r ) { |
| 131 | + global $wgUser, $wgLang; |
| 132 | + $sk = $wgUser->getSkin(); |
| 133 | + $timestamp = $wgLang->timeanddate( $r->getTimestamp(), true ); |
| 134 | + $blockerlink = $sk->userLink( $r->getBlockerId(), $r->getBlockerText() ) . |
| 135 | + $sk->userToolLinks( $r->getBlockerId(), $r->getBlockerText() ); |
| 136 | + $subjlink = $sk->userLink( $r->getSubjectId(), $r->getSubjectText() ) . |
| 137 | + $sk->userToolLinks( $r->getSubjectId(), $r->getSubjectText() ); |
| 138 | + $expiry = is_numeric( $r->getExpiry() ) ? |
| 139 | + wfMsg( 'listuserrestrictions-row-expiry', $wgLang->timeanddate( $r->getExpiry() ) ) : |
| 140 | + wfMsg( 'ipbinfinite' ); |
| 141 | + $msg = ''; |
| 142 | + if( $r->isNamespace() ) { |
| 143 | + $msg = wfMsgHtml( 'listuserrestrictions-row-ns', $subjlink, |
| 144 | + htmlspecialchars( $wgLang->getDisplayNsText( $r->getNamespace() ) ), |
| 145 | + htmlspecialchars( $expiry ) |
| 146 | + ); |
| 147 | + } |
| 148 | + if( $r->isPage() ) { |
| 149 | + $pagelink = $sk->link( $r->getPage() ); |
| 150 | + $msg = wfMsgHtml( 'listuserrestrictions-row-page', $subjlink, |
| 151 | + $pagelink, htmlspecialchars( $expiry ) ); |
| 152 | + } |
| 153 | + $reason = $sk->commentBlock( $r->getReason() ); |
| 154 | + $removelink = ''; |
| 155 | + if( $wgUser->isAllowed( 'restrict' ) ) { |
| 156 | + $removelink = '(' . $sk->link( SpecialPage::getTitleFor( 'RemoveRestrictions' ), |
| 157 | + wfMsgHtml( 'listuserrestrictions-remove' ), array(), array( 'id' => $r->getId() ) ) . ')'; |
| 158 | + } |
| 159 | + return "<li>{$timestamp}, {$blockerlink} {$msg} {$reason} {$removelink}</li>\n"; |
| 160 | + } |
| 161 | + |
| 162 | + public function getIndexField() { |
| 163 | + return 'ur_timestamp'; |
| 164 | + } |
| 165 | +} |
Property changes on: trunk/phase3/includes/specials/SpecialListUserRestrictions.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 166 | + native |
Index: trunk/phase3/includes/specials/SpecialAllpages.php |
— | — | @@ -391,7 +391,7 @@ |
392 | 392 | |
393 | 393 | $prevLink = $sk->linkKnown( |
394 | 394 | $self, |
395 | | - wfMsgHTML( 'prevpage', htmlspecialchars( $pt ) ), |
| 395 | + htmlspecialchars( wfMsg( 'prevpage', $pt ) ), |
396 | 396 | array(), |
397 | 397 | $query |
398 | 398 | ); |
— | — | @@ -408,7 +408,7 @@ |
409 | 409 | |
410 | 410 | $nextLink = $sk->linkKnown( |
411 | 411 | $self, |
412 | | - wfMsgHtml( 'nextpage', htmlspecialchars( $t->getText() ) ), |
| 412 | + htmlspecialchars( wfMsg( 'nextpage', $t->getText() ) ), |
413 | 413 | array(), |
414 | 414 | $query |
415 | 415 | ); |
Index: trunk/phase3/includes/specials/SpecialFileDuplicateSearch.php |
— | — | @@ -125,14 +125,14 @@ |
126 | 126 | |
127 | 127 | # Show a short summary |
128 | 128 | if( $count == 1 ) { |
129 | | - $wgOut->addHTML( '<p class="mw-fileduplicatesearch-result-1">' . |
130 | | - wfMsgHtml( 'fileduplicatesearch-result-1', $filename ) . |
131 | | - '</p>' |
| 129 | + $wgOut->wrapWikiMsg( |
| 130 | + "<p class='mw-fileduplicatesearch-result-1'>\n$1\n</p>", |
| 131 | + array( 'fileduplicatesearch-result-1', $filename ) |
132 | 132 | ); |
133 | 133 | } elseif ( $count > 1 ) { |
134 | | - $wgOut->addHTML( '<p class="mw-fileduplicatesearch-result-n">' . |
135 | | - wfMsgExt( 'fileduplicatesearch-result-n', array( 'parseinline' ), $filename, $wgLang->formatNum( $count - 1 ) ) . |
136 | | - '</p>' |
| 134 | + $wgOut->wrapWikiMsg( |
| 135 | + "<p class='mw-fileduplicatesearch-result-n'>\n$1\n</p>", |
| 136 | + array( 'fileduplicatesearch-result-n', $filename, $wgLang->formatNum( $count - 1 ) ) |
137 | 137 | ); |
138 | 138 | } |
139 | 139 | } |
Index: trunk/phase3/includes/specials/SpecialNewimages.php |
— | — | @@ -188,14 +188,11 @@ |
189 | 189 | $searchpar |
190 | 190 | ); |
191 | 191 | |
192 | | - $message = wfMsgHtml( |
193 | | - 'showhidebots', |
194 | | - ( $hidebots ? wfMsgHtml( 'show' ) : wfMsgHtml( 'hide' ) ) |
195 | | - ); |
| 192 | + $showhide = $hidebots ? wfMsg( 'show' ) : wfMsg( 'hide' ); |
196 | 193 | |
197 | 194 | $botLink = $sk->linkKnown( |
198 | 195 | $titleObj, |
199 | | - $message, |
| 196 | + htmlspecialchars( wfMsg( 'showhidebots', $showhide ) ), |
200 | 197 | array(), |
201 | 198 | $query |
202 | 199 | ); |
Index: trunk/phase3/includes/specials/SpecialUpload.php |
— | — | @@ -545,7 +545,7 @@ |
546 | 546 | $skin = $wgUser->getSkin(); |
547 | 547 | $wsize = $skin->formatSize( $wgUploadSizeWarning ); |
548 | 548 | $asize = $skin->formatSize( $this->mFileSize ); |
549 | | - $warning .= '<li>' . wfMsgHtml( 'large-file', $wsize, $asize ) . '</li>'; |
| 549 | + $warning .= '<li>' . htmlspecialchars( wfMsg( 'large-file', $wsize, $asize ) ) . '</li>'; |
550 | 550 | } |
551 | 551 | if ( $this->mFileSize == 0 ) { |
552 | 552 | $warning .= '<li>'.wfMsgHtml( 'emptyfile' ).'</li>'; |
Index: trunk/phase3/includes/specials/SpecialMIMEsearch.php |
— | — | @@ -73,8 +73,10 @@ |
74 | 74 | $download = $skin->makeMediaLinkObj( $nt, wfMsgHtml( 'download' ) ); |
75 | 75 | $bytes = wfMsgExt( 'nbytes', array( 'parsemag', 'escape'), |
76 | 76 | $wgLang->formatNum( $result->img_size ) ); |
77 | | - $dimensions = wfMsgHtml( 'widthheight', $wgLang->formatNum( $result->img_width ), |
78 | | - $wgLang->formatNum( $result->img_height ) ); |
| 77 | + $dimensions = htmlspecialchars( wfMsg( 'widthheight', |
| 78 | + $wgLang->formatNum( $result->img_width ), |
| 79 | + $wgLang->formatNum( $result->img_height ) |
| 80 | + ) ); |
79 | 81 | $user = $skin->link( Title::makeTitle( NS_USER, $result->img_user_text ), htmlspecialchars( $result->img_user_text ) ); |
80 | 82 | $time = htmlspecialchars( $wgLang->timeanddate( $result->img_timestamp ) ); |
81 | 83 | |
Index: trunk/phase3/includes/specials/SpecialBlockip.php |
— | — | @@ -671,15 +671,15 @@ |
672 | 672 | $query = array( 'action' => 'unblock' ); |
673 | 673 | |
674 | 674 | if( $this->BlockAddress ) { |
675 | | - $addr = htmlspecialchars( strtr( $this->BlockAddress, '_', ' ' ) ); |
676 | | - $message = wfMsgHtml( 'ipb-unblock-addr', $addr ); |
| 675 | + $addr = strtr( $this->BlockAddress, '_', ' ' ); |
| 676 | + $message = wfMsg( 'ipb-unblock-addr', $addr ); |
677 | 677 | $query['ip'] = $this->BlockAddress; |
678 | 678 | } else { |
679 | | - $message = wfMsgHtml( 'ipb-unblock' ); |
| 679 | + $message = wfMsg( 'ipb-unblock' ); |
680 | 680 | } |
681 | 681 | return $skin->linkKnown( |
682 | 682 | $list, |
683 | | - $message, |
| 683 | + htmlspecialchars($message), |
684 | 684 | array(), |
685 | 685 | $query |
686 | 686 | ); |
— | — | @@ -696,16 +696,16 @@ |
697 | 697 | $query = array(); |
698 | 698 | |
699 | 699 | if( $this->BlockAddress ) { |
700 | | - $addr = htmlspecialchars( strtr( $this->BlockAddress, '_', ' ' ) ); |
701 | | - $message = wfMsgHtml( 'ipb-blocklist-addr', $addr ); |
| 700 | + $addr = strtr( $this->BlockAddress, '_', ' ' ); |
| 701 | + $message = wfMsg( 'ipb-blocklist-addr', $addr ); |
702 | 702 | $query['ip'] = $this->BlockAddress; |
703 | 703 | } else { |
704 | | - $message = wfMsgHtml( 'ipb-blocklist' ); |
| 704 | + $message = wfMsg( 'ipb-blocklist' ); |
705 | 705 | } |
706 | 706 | |
707 | 707 | return $skin->linkKnown( |
708 | 708 | $list, |
709 | | - $message, |
| 709 | + htmlspecialchars($message), |
710 | 710 | array(), |
711 | 711 | $query |
712 | 712 | ); |
Index: trunk/phase3/includes/specials/SpecialDeletedContributions.php |
— | — | @@ -71,9 +71,10 @@ |
72 | 72 | if ( isset( $this->mNavigationBar ) ) { |
73 | 73 | return $this->mNavigationBar; |
74 | 74 | } |
| 75 | + $fmtLimit = $wgLang->formatNum( $this->mLimit ); |
75 | 76 | $linkTexts = array( |
76 | | - 'prev' => wfMsgHtml( 'pager-newer-n', $this->mLimit ), |
77 | | - 'next' => wfMsgHtml( 'pager-older-n', $this->mLimit ), |
| 77 | + 'prev' => wfMsgExt( 'pager-newer-n', array( 'escape', 'parsemag' ), $fmtLimit ), |
| 78 | + 'next' => wfMsgExt( 'pager-older-n', array( 'escape', 'parsemag' ), $fmtLimit ), |
78 | 79 | 'first' => wfMsgHtml( 'histlast' ), |
79 | 80 | 'last' => wfMsgHtml( 'histfirst' ) |
80 | 81 | ); |
Index: trunk/phase3/languages/messages/MessagesEn.php |
— | — | @@ -889,7 +889,7 @@ |
890 | 890 | 'newmessageslink' => 'new messages', |
891 | 891 | 'newmessagesdifflink' => 'last change', |
892 | 892 | 'youhavenewmessagesmulti' => 'You have new messages on $1', |
893 | | -'newtalkseparator' => ',_', # do not translate or duplicate this message to other languages |
| 893 | +'newtalkseparator' => ', ', # do not translate or duplicate this message to other languages |
894 | 894 | 'editsection' => 'edit', |
895 | 895 | 'editsection-brackets' => '[$1]', # only translate this message to other languages if you have to change it |
896 | 896 | 'editold' => 'edit', |