Index: trunk/phase3/includes/ChangesList.php |
— | — | @@ -131,12 +131,40 @@ |
132 | 132 | * @param $key string 'newpage', 'unpatrolled', 'minor', or 'bot' |
133 | 133 | * @return string Raw HTML |
134 | 134 | */ |
135 | | - public static function flagLegend( $key ) { |
| 135 | + private static function flagLine( $key ) { |
136 | 136 | return wfMsgExt( "recentchanges-legend-$key", array( 'escapenoentities', |
137 | 137 | 'replaceafter' ), self::flag( $key ) ); |
138 | 138 | } |
139 | 139 | |
140 | 140 | /** |
| 141 | + * A handy legend to tell users what the little "m", "b", and so on mean. |
| 142 | + * |
| 143 | + * @return string Raw HTML |
| 144 | + */ |
| 145 | + public static function flagLegend() { |
| 146 | + global $wgGroupPermissions, $wgLang; |
| 147 | + |
| 148 | + $flags = array( self::flagLine( 'newpage' ), |
| 149 | + self::flagLine( 'minor' ) ); |
| 150 | + |
| 151 | + # Don't show info on bot edits unless there's a bot group of some kind |
| 152 | + foreach ( $wgGroupPermissions as $rights ) { |
| 153 | + if ( isset( $rights['bot'] ) && $rights['bot'] ) { |
| 154 | + $flags[] = self::flagLine( 'bot' ); |
| 155 | + break; |
| 156 | + } |
| 157 | + } |
| 158 | + |
| 159 | + if ( self::usePatrol() ) { |
| 160 | + $flags[] = self::flagLine( 'unpatrolled' ); |
| 161 | + } |
| 162 | + |
| 163 | + return '<div class="mw-rc-label-legend">' . |
| 164 | + wfMsgWikiHtml( 'recentchanges-label-legend', $wgLang->commaList( $flags ) ) |
| 165 | + . '</div>'; |
| 166 | + } |
| 167 | + |
| 168 | + /** |
141 | 169 | * Returns text for the start of the tabular part of RC |
142 | 170 | * @return string |
143 | 171 | */ |
Index: trunk/phase3/includes/specials/SpecialRecentchanges.php |
— | — | @@ -408,7 +408,7 @@ |
409 | 409 | * @return String: XHTML |
410 | 410 | */ |
411 | 411 | public function doHeader( $opts ) { |
412 | | - global $wgScript, $wgOut, $wgLang, $wgUser, $wgGroupPermissions; |
| 412 | + global $wgScript, $wgOut; |
413 | 413 | |
414 | 414 | $this->setTopText( $wgOut, $opts ); |
415 | 415 | |
— | — | @@ -457,26 +457,8 @@ |
458 | 458 | Xml::fieldset( wfMsg( 'recentchanges-legend' ), $panelString, array( 'class' => 'rcoptions' ) ) |
459 | 459 | ); |
460 | 460 | |
461 | | - $flags = array( ChangesList::flagLegend( 'newpage' ), |
462 | | - ChangesList::flagLegend( 'minor' ) ); |
| 461 | + $wgOut->addHTML( ChangesList::flagLegend() ); |
463 | 462 | |
464 | | - # Don't show info on bot edits unless there's a bot group of some kind |
465 | | - foreach ( $wgGroupPermissions as $rights ) { |
466 | | - if ( isset( $rights['bot'] ) && $rights['bot'] ) { |
467 | | - $flags[] = ChangesList::flagLegend( 'bot' ); |
468 | | - break; |
469 | | - } |
470 | | - } |
471 | | - |
472 | | - if ( $wgUser->useRCPatrol() ) { |
473 | | - $flags[] = ChangesList::flagLegend( 'unpatrolled' ); |
474 | | - } |
475 | | - |
476 | | - $wgOut->addHTML( '<div class="mw-rc-label-legend">' ); |
477 | | - $wgOut->addWikiMsg( 'recentchanges-label-legend', |
478 | | - $wgLang->commaList( $flags ) ); |
479 | | - $wgOut->addHTML( '</div>' ); |
480 | | - |
481 | 463 | $this->setBottomText( $wgOut, $opts ); |
482 | 464 | } |
483 | 465 | |
Index: trunk/phase3/includes/specials/SpecialWatchlist.php |
— | — | @@ -290,9 +290,7 @@ |
291 | 291 | $form .= Xml::closeElement( 'fieldset' ); |
292 | 292 | $wgOut->addHTML( $form ); |
293 | 293 | |
294 | | - $wgOut->addWikiMsg( 'recentchanges-label-legend', |
295 | | - ChangesList::flag( 'newpage' ), ChangesList::flag( 'minor' ), |
296 | | - ChangesList::flag( 'bot' ), ChangesList::flag( 'unpatrolled' ) ); |
| 294 | + $wgOut->addHTML( ChangesList::flagLegend() ); |
297 | 295 | |
298 | 296 | # If there's nothing to show, stop here |
299 | 297 | if( $numRows == 0 ) { |