| Index: trunk/phase3/maintenance/language/messages.inc |
| — | — | @@ -1151,9 +1151,13 @@ |
| 1152 | 1152 | 'recentchangestext', |
| 1153 | 1153 | 'recentchanges-feed-description', |
| 1154 | 1154 | 'recentchanges-label-legend', |
| | 1155 | + 'recentchanges-legend-newpage', |
| 1155 | 1156 | 'recentchanges-label-newpage', |
| | 1157 | + 'recentchanges-legend-minor', |
| 1156 | 1158 | 'recentchanges-label-minor', |
| | 1159 | + 'recentchanges-legend-bot', |
| 1157 | 1160 | 'recentchanges-label-bot', |
| | 1161 | + 'recentchanges-legend-unpatrolled', |
| 1158 | 1162 | 'recentchanges-label-unpatrolled', |
| 1159 | 1163 | 'rcnote', |
| 1160 | 1164 | 'rcnotefrom', |
| Index: trunk/phase3/includes/ChangesList.php |
| — | — | @@ -124,6 +124,19 @@ |
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | /** |
| | 128 | + * Some explanatory wrapper text for the given flag, to be used in a legend |
| | 129 | + * explaining what the flags mean. For instance, "N - new page". See |
| | 130 | + * also flag(). |
| | 131 | + * |
| | 132 | + * @param $key string 'newpage', 'unpatrolled', 'minor', or 'bot' |
| | 133 | + * @return string Raw HTML |
| | 134 | + */ |
| | 135 | + public static function flagLegend( $key ) { |
| | 136 | + return wfMsgExt( "recentchanges-legend-$key", array( 'escapenoentities', |
| | 137 | + 'replaceafter' ), self::flag( $key ) ); |
| | 138 | + } |
| | 139 | + |
| | 140 | + /** |
| 128 | 141 | * Returns text for the start of the tabular part of RC |
| 129 | 142 | * @return string |
| 130 | 143 | */ |
| 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; |
| | 412 | + global $wgScript, $wgOut, $wgLang, $wgUser, $wgGroupPermissions; |
| 413 | 413 | |
| 414 | 414 | $this->setTopText( $wgOut, $opts ); |
| 415 | 415 | |
| — | — | @@ -457,12 +457,23 @@ |
| 458 | 458 | Xml::fieldset( wfMsg( 'recentchanges-legend' ), $panelString, array( 'class' => 'rcoptions' ) ) |
| 459 | 459 | ); |
| 460 | 460 | |
| 461 | | - # TODO: This is probably a bad format for the message. If anyone |
| 462 | | - # customizes it and we add a new flag, it won't show up in the |
| 463 | | - # customized message unless it's changed. |
| | 461 | + $flags = array( ChangesList::flagLegend( 'newpage' ), |
| | 462 | + ChangesList::flagLegend( 'minor' ) ); |
| | 463 | + |
| | 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 | + |
| 464 | 476 | $wgOut->addWikiMsg( 'recentchanges-label-legend', |
| 465 | | - ChangesList::flag( 'newpage' ), ChangesList::flag( 'minor' ), |
| 466 | | - ChangesList::flag( 'bot' ), ChangesList::flag( 'unpatrolled' ) ); |
| | 477 | + $wgLang->commaList( $flags ) ); |
| 467 | 478 | |
| 468 | 479 | $this->setBottomText( $wgOut, $opts ); |
| 469 | 480 | } |
| Index: trunk/phase3/languages/messages/MessagesEn.php |
| — | — | @@ -1964,10 +1964,14 @@ |
| 1965 | 1965 | 'recentchanges-legend' => 'Recent changes options', |
| 1966 | 1966 | 'recentchangestext' => 'Track the most recent changes to the wiki on this page.', |
| 1967 | 1967 | 'recentchanges-feed-description' => 'Track the most recent changes to the wiki in this feed.', |
| 1968 | | -'recentchanges-label-legend' => 'Legend: $1 - new page, $2 - minor edit, $3 - bot edit, $4 - unpatrolled edit.', |
| | 1968 | +'recentchanges-label-legend' => 'Legend: $1.', |
| | 1969 | +'recentchanges-legend-newpage' => '$1 - new page', |
| 1969 | 1970 | 'recentchanges-label-newpage' => 'This edit created a new page', |
| | 1971 | +'recentchanges-legend-minor' => '$1 - minor edit', |
| 1970 | 1972 | 'recentchanges-label-minor' => 'This is a minor edit', |
| | 1973 | +'recentchanges-legend-bot' => '$1 - bot edit', |
| 1971 | 1974 | 'recentchanges-label-bot' => 'This edit was performed by a bot', |
| | 1975 | +'recentchanges-legend-unpatrolled' => '$1 - unpatrolled edit', |
| 1972 | 1976 | 'recentchanges-label-unpatrolled' => 'This edit has not yet been patrolled', |
| 1973 | 1977 | 'rcnote' => "Below {{PLURAL:$1|is '''1''' change|are the last '''$1''' changes}} in the last {{PLURAL:$2|day|'''$2''' days}}, as of $5, $4.", |
| 1974 | 1978 | 'rcnotefrom' => "Below are the changes since '''$2''' (up to '''$1''' shown).", |