r99372 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r99371‎ | r99372 | r99373 >
Date:19:56, 9 October 2011
Author:jeroendedauw
Status:deferred (Comments)
Tags:
Comment:
added comment permalink
Modified paths:
  • /trunk/extensions/Contest/Contest.i18n.php (modified) (history)
  • /trunk/extensions/Contest/specials/SpecialContestant.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Contest/Contest.i18n.php
@@ -171,6 +171,7 @@
172172 'contest-contestant-rate' => 'Rate this contestant',
173173 'contest-contestant-not-voted' => 'You have not voted on this participant yet.',
174174 'contest-contestant-voted' => 'Your current vote is $1.',
 175+ 'contest-contestant-permalink' => 'Permalink',
175176 );
176177
177178 /** Message documentation (Message documentation)
Index: trunk/extensions/Contest/specials/SpecialContestant.php
@@ -303,9 +303,19 @@
304304 protected function getCommentHTML( ContestComment $comment ) {
305305 $user = User::newFromId( $comment->getField( 'user_id' ) );
306306
 307+ $htmlId = 'c' . $comment->getId();
 308+
307309 $html = Html::rawElement(
308310 'div',
309311 array( 'class' => 'contestant-comment-meta' ),
 312+ Html::element(
 313+ 'a',
 314+ array(
 315+ 'href' => $this->getTitle( $this->subPage )->getLocalURL() . "#$htmlId",
 316+ 'title' => wfMsg( 'contest-contestant-permalink' )
 317+ ),
 318+ '#'
 319+ ) .
310320 wfMsgHtml(
311321 'contest-contestant-comment-by',
312322 Linker::userLink( $comment->getField( 'user_id' ), $user->getName() ) .
@@ -323,6 +333,7 @@
324334 'div',
325335 array(
326336 'class' => 'contestant-comment',
 337+ 'id' => $htmlId
327338 ),
328339 $html
329340 );

Comments

#Comment by Nikerabbit (talk | contribs)   17:14, 11 October 2011

Is comment id always a number?

#Comment by Jeroen De Dauw (talk | contribs)   17:19, 11 October 2011

Yeah

Status & tagging log