r99801 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r99800‎ | r99801 | r99802 >
Date:20:36, 14 October 2011
Author:ialex
Status:ok
Tags:
Comment:
* Inlinised wfShowingResults()
* Pass a Title object to wfViewPrevNext()
* Use OutputPage::addWikiMsg() to display 'specialpage-empty' message
* Fixed calls to $this->getTitle() in QueryPage subclasses since they use to old way (i.e. not the same object as the special page) which throws "Invalid special page name: ''" when called
Modified paths:
  • /trunk/extensions/EditConflict/CurrentEdits.php (modified) (history)

Diff [purge]

Index: trunk/extensions/EditConflict/CurrentEdits.php
@@ -120,20 +120,19 @@
121121
122122 // if list is empty, display a warning
123123 if( $num == 0 ) {
124 - $wgOut->addHTML( '<p>' . wfMsgHTML('specialpage-empty') . '</p>' );
 124+ $wgOut->addWikiMsg( 'specialpage-empty' );
125125 return;
126126 }
127127
128 - $top = wfShowingResults( $offset, $num );
129 - $wgOut->addHTML( "<p>{$top}\n" );
 128+ $wgOut->addHTML( wfMsgExt( 'showingresults', 'parse',
 129+ $wgLang->formatNum( $num ), $wgLang->formatNum( $offset + 1 ) ) );
130130
131131 // often disable 'next' link when we reach the end
132132 $atend = $num < $limit;
133133
134 - $sl = wfViewPrevNext( $offset, $limit ,
135 - $wgContLang->specialPage( $sname ),
 134+ $sl = wfViewPrevNext( $offset, $limit, SpecialPage::getTitleFor( 'CurrentEdits' ),
136135 wfArrayToCGI( $this->linkParameters() ), $atend );
137 - $wgOut->addHTML( "<br />{$sl}</p>\n" );
 136+ $wgOut->addHTML( "<p>{$sl}</p>\n" );
138137 }
139138 if ( $num > 0 ) {
140139 $s = array();
@@ -205,7 +204,7 @@
206205 $this->order_queries[ $order_key ] = $msg;
207206 } else {
208207 # link all other orders
209 - $this->order_queries[ $order_key ] = $skin->makeKnownLinkObj( $this->getTitle(), $msg , $action );
 208+ $this->order_queries[ $order_key ] = $skin->makeKnownLinkObj( SpecialPage::getTitleFor( 'CurrentEdits' ), $msg , $action );
210209 }
211210 }
212211 }
@@ -270,7 +269,7 @@
271270 if ( $this->order_key != EC_DEFAULT_ORDER_KEY ) {
272271 $action .= '&order=' . $this->order_key;
273272 }
274 - $session_close_link = $skin->makeKnownLinkObj( $this->getTitle(), '&#8251;', $action, '', '', 'title="Close this session."' );
 273+ $session_close_link = $skin->makeKnownLinkObj( SpecialPage::getTitleFor( 'CurrentEdits' ), '&#8251;', $action, '', '', 'title="Close this session."' );
275274 return wfMsg( 'ec_list_order_' . $this->order_key, $title_link, $user_page_link, htmlspecialchars( $user_weight ), htmlspecialchars( $editing_time ), $session_close_link );
276275 }
277276
@@ -287,4 +286,4 @@
288287 return $params;
289288 }
290289
291 -}
\ No newline at end of file
 290+}

Sign-offs

UserFlagDate
Nikerabbitinspected09:48, 16 October 2011

Status & tagging log