$nondefaults = $opts->getChangedValues();
$panel = array();
+ $panel[] = self::makeLegend( $this->getContext() );
$panel[] = $this->optionsPanel( $defaults, $nondefaults );
$panel[] = '<hr />';
return $extraOpts;
}
+ /**
+ * Return the legend displayed within the fieldset
+ *
+ * @param $context the object available as $this in non-static functions
+ * @return string
+ */
+ public static function makeLegend( IContextSource $context ) {
+ $user = $context->getUser();
+ # The legend showing what the letters and stuff mean
+ $legend = Xml::openElement( 'dl', array( 'class' => 'mw-changeslist-legend' ) ) . "\n";
+ # Iterates through them and gets the messages for both letter and tooltip
+ # Messages:
+ # * minoreditletter
+ # * boteditletter
+ # * newpageletter
+ # * unpatrolledletter
+ # * recentchanges-label-minor
+ # * recentchanges-label-bot
+ # * recentchanges-label-newpage
+ # * recentchanges-label-unpatrolled
+ $legendItems = array( 'newpage' => 'newpage', 'minor' => 'minoredit', 'bot' => 'botedit' );
+ if ( $user->useRCPatrol() ) {
+ $legendItems['unpatrolled'] = 'unpatrolled';
+ }
+ foreach ( $legendItems as $label => $letter ) { # generate items of the legend
+ $legend .= Xml::element( 'dt',
+ array( 'class' => $label ), $context->msg( $letter . 'letter' )->text()
+ ) . "\n";
+ if ( $letter === 'newpage' ) {
+ $legend .= Xml::openElement( 'dd' );
+ $legend .= $context->msg( "recentchanges-label-$label" )->escaped();
+ $legend .= ' ' . $context->msg( 'recentchanges-legend-newpage' )->parse();
+ $legend .= Xml::closeElement( 'dd' ) . "\n";
+ } else {
+ $legend .= Xml::element( 'dd', array(),
+ $context->msg( "recentchanges-label-$label" )->text()
+ ) . "\n";
+ }
+ }
+ # (+-123)
+ $legend .= Xml::tags( 'dt',
+ array( 'class' => 'mw-plusminus-pos' ),
+ $context->msg( 'recentchanges-legend-plusminus' )->parse()
+ ) . "\n";
+ $legend .= Xml::element(
+ 'dd',
+ array( 'class' => 'mw-changeslist-legend-plusminus' ),
+ $context->msg( 'recentchanges-label-plusminus' )->text()
+ ) . "\n";
+ $legend .= Xml::closeElement( 'dl' ) . "\n";
+ return $legend;
+ }
+
/**
* Send the text to be displayed above the options
*
$user = $this->getUser();
$output = $this->getOutput();
+ $output->addModuleStyles( 'mediawiki.special.changeslist' );
# Anons don't get a watchlist
$this->requireLogin( 'watchlistanontext' );
array( 'id' => 'mw-watchlist-options' )
);
+ $form .= SpecialRecentChanges::makeLegend( $this->getContext() );
+
$tables = array( 'recentchanges', 'watchlist' );
$fields = RecentChange::selectFields();
$join_conds = array(
'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',
+'recentchanges-label-plusminus' => 'The page size changed by this number of bytes',
+'recentchanges-legend-newpage' => '(also see [[Special:NewPages|list of new pages]])',
+'recentchanges-legend-plusminus' => "(''±123'')",
'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',
* @author SPQRobin
* @author Sanbec
* @author Sborsody
+ * @author Scimonster
* @author Se4598
* @author Seb35
* @author Sherbrooke
'recentchanges-label-minor' => 'Tooltip for {{msg-mw|minoreditletter}}',
'recentchanges-label-bot' => 'Tooltip for {{msg-mw|boteditletter}}',
'recentchanges-label-unpatrolled' => 'Tooltip for {{msg-mw|unpatrolledletter}}',
+'recentchanges-label-plusminus' => 'Legend item for plus/minus',
+'recentchanges-legend-newpage' => 'A link to [[Special:NewPages]]',
+'recentchanges-legend-plusminus' => 'A plus/minus sign with a number for the legend.',
'rcnote' => 'Used on [[Special:RecentChanges]].
Similar to {{msg-mw|wlnote}} which is used on [[Special:Watchlist]].
'recentchanges-label-minor',
'recentchanges-label-bot',
'recentchanges-label-unpatrolled',
+ 'recentchanges-label-plusminus',
+ 'recentchanges-legend-newpage',
+ 'recentchanges-legend-plusminus',
'rcnote',
'rcnotefrom',
'rclistfrom',
.mw-changeslist-line-watched .mw-title {
font-weight: bold;
}
+
+.mw-changeslist-legend {
+ float: right;
+ margin-left: 1em;
+ margin-bottom: 0.5em;
+ clear: right;
+ font-size: 85%;
+ line-height: 1.2em;
+ padding: 0.5em;
+ border: 1px solid #ddd;
+}
+
+.mw-changeslist-legend dt {
+ float: left;
+}
+
+.mw-changeslist-legend dd {
+ margin-left: 1.5em;
+ line-height: 1.3em;
+}
+
+.mw-changeslist-legend dd.mw-changeslist-legend-plusminus {
+ margin-left: 3.5em;
+}