X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fspecialpage%2FChangesListSpecialPage.php;h=ad1ee36a8ddae1225adb9e3881ca6531ab2799f9;hb=4f1390819a8fcd91c0c34449736fff4548032ad3;hp=bc0b8ff26b011656e3540db847f39e165b6a7cac;hpb=996eed90e787171e9ec853441f15cd66b2fe8cc5;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specialpage/ChangesListSpecialPage.php b/includes/specialpage/ChangesListSpecialPage.php index bc0b8ff26b..ad1ee36a8d 100644 --- a/includes/specialpage/ChangesListSpecialPage.php +++ b/includes/specialpage/ChangesListSpecialPage.php @@ -164,7 +164,7 @@ abstract class ChangesListSpecialPage extends SpecialPage { * * Intended for subclassing, e.g. to add a backwards-compatibility layer. * - * @param FormOptions $parameters + * @param FormOptions $opts * @return FormOptions */ protected function fetchOptionsFromRequest( $opts ) { @@ -398,49 +398,42 @@ abstract class ChangesListSpecialPage extends SpecialPage { * @todo This should not be static, then we can drop the parameter * @todo Not called by anything, should be called by doHeader() * - * @param $context the object available as $this in non-static functions + * @param IContextSource $context The object available as $this in non-static functions * @return string */ public static function makeLegend( IContextSource $context ) { global $wgRecentChangesFlags; $user = $context->getUser(); # The legend showing what the letters and stuff mean - $legend = Xml::openElement( 'dl' ) . "\n"; + $legend = Html::openElement( 'dl' ) . "\n"; # Iterates through them and gets the messages for both letter and tooltip $legendItems = $wgRecentChangesFlags; - if ( !$user->useRCPatrol() ) { + if ( !( $user->useRCPatrol() || $user->useNPPatrol() ) ) { unset( $legendItems['unpatrolled'] ); } - foreach ( $legendItems as $key => $legendInfo ) { # generate items of the legend - $label = $legendInfo['title']; - $letter = $legendInfo['letter']; - $cssClass = isset( $legendInfo['class'] ) ? $legendInfo['class'] : $key; + foreach ( $legendItems as $key => $item ) { # generate items of the legend + $label = isset( $item['legend'] ) ? $item['legend'] : $item['title']; + $letter = $item['letter']; + $cssClass = isset( $item['class'] ) ? $item['class'] : $key; - $legend .= Xml::element( 'dt', + $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 .= Xml::openElement( 'dd' ); - $legend .= $context->msg( $label )->escaped(); - $legend .= ' ' . $context->msg( 'recentchanges-legend-newpage' )->parse(); - $legend .= Xml::closeElement( 'dd' ) . "\n"; - } else { - $legend .= Xml::element( 'dd', array(), - $context->msg( $label )->text() - ) . "\n"; - } } # (+-123) - $legend .= Xml::tags( 'dt', + $legend .= Html::rawElement( 'dt', array( 'class' => 'mw-plusminus-pos' ), $context->msg( 'recentchanges-legend-plusminus' )->parse() ) . "\n"; - $legend .= Xml::element( + $legend .= Html::element( 'dd', array( 'class' => 'mw-changeslist-legend-plusminus' ), $context->msg( 'recentchanges-label-plusminus' )->text() ) . "\n"; - $legend .= Xml::closeElement( 'dl' ) . "\n"; + $legend .= Html::closeElement( 'dl' ) . "\n"; # Collapsibility $legend =