* To register a new one:
* @code
* $wgRecentChangesFlags['flag'] => array(
+ * // message for the letter displayed next to rows on changes lists
* 'letter' => 'letter-msg',
- * 'title' => 'tooltip-msg'
+ * // message for the tooltip of the letter
+ * 'title' => 'tooltip-msg',
+ * // optional (defaults to 'tooltip-msg'), message to use in the legend box
+ * 'legend' => 'legend-msg',
+ * // optional (defaults to 'flag'), CSS class to put on changes lists rows
+ * 'class' => 'css-class',
* );
* @endcode
*
- * Optional 'class' allows to set a css class different than the flag name.
- *
* @since 1.22
*/
$wgRecentChangesFlags = array(
- 'newpage' => array( 'letter' => 'newpageletter',
- 'title' => 'recentchanges-label-newpage' ),
- 'minor' => array( 'letter' => 'minoreditletter',
- 'title' => 'recentchanges-label-minor', 'class' => 'minoredit' ),
- 'bot' => array( 'letter' => 'boteditletter',
- 'title' => 'recentchanges-label-bot', 'class' => 'botedit' ),
- 'unpatrolled' => array( 'letter' => 'unpatrolledletter',
- 'title' => 'recentchanges-label-unpatrolled' ),
+ 'newpage' => array(
+ 'letter' => 'newpageletter',
+ 'title' => 'recentchanges-label-newpage',
+ 'legend' => 'recentchanges-legend-newpage',
+ ),
+ 'minor' => array(
+ 'letter' => 'minoreditletter',
+ 'title' => 'recentchanges-label-minor',
+ 'legend' => 'recentchanges-legend-minor',
+ 'class' => 'minoredit',
+ ),
+ 'bot' => array(
+ 'letter' => 'boteditletter',
+ 'title' => 'recentchanges-label-bot',
+ 'legend' => 'recentchanges-legend-bot',
+ 'class' => 'botedit',
+ ),
+ 'unpatrolled' => array(
+ 'letter' => 'unpatrolledletter',
+ 'title' => 'recentchanges-label-unpatrolled',
+ 'legend' => 'recentchanges-legend-unpatrolled',
+ ),
);
/** @} */ # end RC/watchlist }
unset( $legendItems['unpatrolled'] );
}
foreach ( $legendItems as $key => $item ) { # generate items of the legend
- $label = $item['title'];
+ $label = isset( $item['legend'] ) ? $item['legend'] : $item['title'];
$letter = $item['letter'];
$cssClass = isset( $item['class'] ) ? $item['class'] : $key;
$legend .= Html::element( 'dt',
array( 'class' => $cssClass ), $context->msg( $letter )->text()
+ ) . "\n" .
+ Html::rawElement( 'dd', array(),
+ $context->msg( $label )->parse()
) . "\n";
- if ( $key === 'newpage' ) {
- $legend .= Html::openElement( 'dd' );
- $legend .= $context->msg( $label )->escaped();
- $legend .= ' ' . $context->msg( 'recentchanges-legend-newpage' )->parse();
- $legend .= Html::closeElement( 'dd' ) . "\n";
- } else {
- $legend .= Html::element( 'dd', array(),
- $context->msg( $label )->text()
- ) . "\n";
- }
}
# (+-123)
$legend .= Html::rawElement( 'dt',
"recentchanges-label-unpatrolled": "This edit has not yet been patrolled",
"recentchanges-label-plusminus": "The page size changed by this number of bytes",
"recentchanges-legend-heading": "'''Legend:'''",
- "recentchanges-legend-newpage": "(also see [[Special:NewPages|list of new pages]])",
+ "recentchanges-legend-newpage": "{{int:recentchanges-label-newpage}} (also see [[Special:NewPages|list of new pages]])",
+ "recentchanges-legend-minor": "{{int:recentchanges-label-minor}}",
+ "recentchanges-legend-bot": "{{int:recentchanges-label-bot}}",
+ "recentchanges-legend-unpatrolled": "{{int:recentchanges-label-unpatrolled}}",
"recentchanges-legend-plusminus": "(<em>±123</em>)",
"rcnotefrom": "Below are the changes since <strong>$2</strong> (up to <strong>$1</strong> shown).",
"rclistfrom": "Show new changes starting from $2, $3",
"recentchanges-label-unpatrolled": "Tooltip for {{msg-mw|unpatrolledletter}}",
"recentchanges-label-plusminus": "Legend item for plus/minus.\n\nPreceded by legend example {{msg-mw|Recentchanges-legend-plusminus}}.",
"recentchanges-legend-heading": "Used as a heading for legend box on [[Special:RecentChanges]] and [[Special:Watchlist]].\n{{Identical|Legend}}",
- "recentchanges-legend-newpage": "Used as legend in [[Special:RecentChanges]]. Preceded by {{msg-mw|Recentchanges-label-newpage}}.",
+ "recentchanges-legend-newpage": "Used as legend on [[Special:RecentChanges]] and [[Special:Watchlist]].",
+ "recentchanges-legend-minor": "Used as legend on [[Special:RecentChanges]] and [[Special:Watchlist]].",
+ "recentchanges-legend-bot": "Used as legend on [[Special:RecentChanges]] and [[Special:Watchlist]].",
+ "recentchanges-legend-unpatrolled": "Used as legend on [[Special:RecentChanges]] and [[Special:Watchlist]].",
"recentchanges-legend-plusminus": "{{optional}}\nA plus/minus sign with a number for the legend.",
"rcnotefrom": "This message is displayed at [[Special:RecentChanges]] when viewing recentchanges from some specific time.\n\nThe corresponding message is {{msg-mw|Rclistfrom}} (split into date and time).\n\nParameters:\n* $1 - the maximum number of changes that are displayed\n* $2 - a date and time\n* $3 - (Optional) a date\n* $4 - (Optional) a time",
"rclistfrom": "Used on [[Special:RecentChanges]]. Parameters:\n* $1 - (Currently not use) date and time. The date and the time adds to the rclistfrom description.\n* $2 - time. The time adds to the rclistfrom link description (with split of date and time).\n* $3 - date. The date adds to the rclistfrom link description (with split of date and time).\n\nThe corresponding message is {{msg-mw|Rcnotefrom}}.",