r43334 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r43333‎ | r43334 | r43335 >
Date:21:44, 9 November 2008
Author:raymond
Status:old
Tags:
Comment:
Use existing function. Now without PHP error. Thanks to Ialex.
Modified paths:
  • /trunk/phase3/includes/ChangesList.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/ChangesList.php
@@ -186,11 +186,8 @@
187187 } else {
188188 $articlelink = ' '. $this->skin->makeKnownLinkObj( $rc->getTitle(), '', $params );
189189 }
190 - if( $watched ) {
191 - $articlelink = "<strong class=\"mw-watched\">{$articlelink}</strong>";
192 - } else {
193 - $articlelink = '<span class="mw-rc-unwatched">' . $articlelink . '</span>';
194 - }
 190+ $articlelink = $this->maybeWatchedLink( $articlelink, $watched );
 191+
195192 global $wgContLang;
196193 $articlelink .= $wgContLang->getDirMark();
197194
@@ -301,6 +298,15 @@
302299 return true;
303300 }
304301 }
 302+
 303+ protected function maybeWatchedLink( $link, $watched=false ) {
 304+ if( $watched ) {
 305+ // FIXME: css style might be more appropriate
 306+ return '<strong class="mw-watched">' . $link . '</strong>';
 307+ } else {
 308+ return '<span class="mw-rc-unwatched">' . $link . '</span>';
 309+ }
 310+ }
305311 }
306312
307313
@@ -770,15 +776,6 @@
771777 return $r;
772778 }
773779
774 - protected function maybeWatchedLink( $link, $watched=false ) {
775 - if( $watched ) {
776 - // FIXME: css style might be more appropriate
777 - return '<strong class="mw-watched">' . $link . '</strong>';
778 - } else {
779 - return '<span class="mw-rc-unwatched">' . $link . '</span>';
780 - }
781 - }
782 -
783780 /**
784781 * Generate HTML for an arrow or placeholder graphic
785782 * @param string $dir one of '', 'd', 'l', 'r'

Status & tagging log