* Simon Walker
* Stefano Codari
* Str4nd
+* svip
== Translators ==
* Anders Wegge Jakobsen
* (bug 16322) Allow maintenance scripts to accept DB user/pass over input or params
* (bug 18566) Maintenance script to un/protect pages
* (bug 671) The HTML <abbr> tag is now permitted.
+* RecentChanges now has a legend to explain what the Nmb! flags mean, and the
+ flags have tooltips.
=== Bug fixes in 1.16 ===
*/
private function preCacheMessages() {
if( !isset( $this->message ) ) {
- foreach( explode(' ', 'cur diff hist minoreditletter newpageletter last '.
- 'blocklink history boteditletter semicolon-separator pipe-separator' ) as $msg ) {
+ foreach ( explode( ' ', 'cur diff hist last blocklink history ' .
+ 'semicolon-separator pipe-separator' ) as $msg ) {
$this->message[$msg] = wfMsgExt( $msg, array( 'escapenoentities' ) );
}
}
* @return string
*/
protected function recentChangesFlags( $new, $minor, $patrolled, $nothing = ' ', $bot = false ) {
- $f = $new ?
- '<abbr class="newpage">' . $this->message['newpageletter'] . '</abbr>' : $nothing;
- $f .= $minor ?
- '<abbr class="minor">' . $this->message['minoreditletter'] . '</abbr>' : $nothing;
- $f .= $bot ? '<abbr class="bot">' . $this->message['boteditletter'] . '</abbr>' : $nothing;
- $f .= $patrolled ? '<span class="unpatrolled">!</span>' : $nothing;
+ $f = $new ? self::flag( 'newpage' ) : $nothing;
+ $f .= $minor ? self::flag( 'minor' ) : $nothing;
+ $f .= $bot ? self::flag( 'bot' ) : $nothing;
+ $f .= $patrolled ? self::flag( 'unpatrolled' ) : $nothing;
return $f;
}
+ /**
+ * Provide the <abbr> element appropriate to a given abbreviated flag,
+ * namely the flag indicating a new page, a minor edit, a bot edit, or an
+ * unpatrolled edit. By default in English it will contain "N", "m", "b",
+ * "!" respectively, plus it will have an appropriate title and class.
+ *
+ * @param $key string 'newpage', 'unpatrolled', 'minor', or 'bot'
+ * @return string Raw HTML
+ */
+ public static function flag( $key ) {
+ static $messages = null;
+ if ( is_null( $messages ) ) {
+ foreach ( explode( ' ', 'minoreditletter boteditletter newpageletter ' .
+ 'unpatrolledletter recentchanges-label-minor recentchanges-label-bot ' .
+ 'recentchanges-label-newpage recentchanges-label-unpatrolled' ) as $msg ) {
+ $messages[$msg] = wfMsgExt( $msg, 'escapenoentities' );
+ }
+ }
+ # Inconsistent naming, bleh
+ if ( $key == 'newpage' || $key == 'unpatrolled' ) {
+ $key2 = $key;
+ } else {
+ $key2 = $key . 'edit';
+ }
+ return "<abbr class=\"$key\" title=\""
+ . $messages["recentchanges-label-$key"] . "\">"
+ . $messages["${key2}letter"]
+ . '</abbr>';
+ }
+
/**
* Returns text for the start of the tabular part of RC
* @return string
Xml::fieldset( wfMsg( 'recentchanges-legend' ), $panelString, array( 'class' => 'rcoptions' ) )
);
+ # TODO: This is probably a bad format for the message. If anyone
+ # customizes it and we add a new flag, it won't show up in the
+ # customized message unless it's changed.
+ $wgOut->addWikiMsg( 'recentchanges-label-legend',
+ ChangesList::flag( 'newpage' ), ChangesList::flag( 'minor' ),
+ ChangesList::flag( 'bot' ), ChangesList::flag( 'unpatrolled' ) );
+
$this->setBottomText( $wgOut, $opts );
}
'recentchanges-legend' => 'Recent changes options',
'recentchangestext' => 'Track the most recent changes to the wiki on this page.',
'recentchanges-feed-description' => 'Track the most recent changes to the wiki in this feed.',
+'recentchanges-label-legend' => "Legend: $1 - new page, $2 - minor edit, $3 - bot edit, $4 - unpatrolled edit.",
+'recentchanges-label-newpage' => 'This edit created a new page',
+'recentchanges-label-minor' => 'This is a minor edit',
+'recentchanges-label-bot' => 'This edit was performed by a bot',
+'recentchanges-label-unpatrolled' => 'This edit has not yet been patrolled',
'rcnote' => "Below {{PLURAL:$1|is '''1''' change|are the last '''$1''' changes}} in the last {{PLURAL:$2|day|'''$2''' days}}, as of $5, $4.",
'rcnotefrom' => "Below are the changes since '''$2''' (up to '''$1''' shown).",
'rclistfrom' => 'Show new changes starting from $1',
'minoreditletter' => 'm',
'newpageletter' => 'N',
'boteditletter' => 'b',
+'unpatrolledletter' => '!', # only translate this message to other languages if you have to change it
'sectionlink' => '→', # only translate this message to other languages if you have to change it
'number_of_watching_users_RCview' => '[$1]', # do not translate or duplicate this message to other languages
'number_of_watching_users_pageview' => '[$1 watching {{PLURAL:$1|user|users}}]',
'timezone-utc',
'whatlinkshere-backlink',
'recentchangeslinked-backlink',
+ 'unpatrolledletter',
'diff-with-additional',
'pagetitle-view-mainpage',
'trackback',
'recentchanges-legend',
'recentchangestext',
'recentchanges-feed-description',
+ 'recentchanges-label-legend',
+ 'recentchanges-label-newpage',
+ 'recentchanges-label-minor',
+ 'recentchanges-label-bot',
+ 'recentchanges-label-unpatrolled',
'rcnote',
'rcnotefrom',
'rclistfrom',
'minoreditletter',
'newpageletter',
'boteditletter',
+ 'unpatrolledletter',
'sectionlink',
'number_of_watching_users_RCview',
'number_of_watching_users_pageview',
background-color: #ffa;
}
-span.unpatrolled {
+.unpatrolled {
font-weight: bold;
color: red;
}
}
/** Generic minor/bot/newpage styling */
-abbr.newpage, abbr.minor, abbr.bot {
+.newpage, .minor, .bot {
font-weight: bold;
}