r71209 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r71208‎ | r71209 | r71210 >
Date:18:51, 17 August 2010
Author:reedy
Status:ok
Tags:
Comment:
Add optional parameter to getFullUrl from r71208, to allow for #c1234

Use getFullUrl in more places
Modified paths:
  • /trunk/extensions/CodeReview/backend/CodeRevision.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CodeReview/backend/CodeRevision.php
@@ -423,9 +423,7 @@
424424 $users[0] = $watcher; // We don't have any anons, so using 0 is safe
425425 }
426426 // Get repo and build comment title (for url)
427 - $title = SpecialPage::getTitleFor( 'Code', $this->mRepo->getName() . '/' . $this->mId );
428 - $title->setFragment( "#c{$commentId}" );
429 - $url = $title->getFullUrl();
 427+ $url = $this->getFullUrl( $commentId );
430428
431429 foreach ( $users as $userId => $user ) {
432430 // No sense in notifying this commenter
@@ -787,8 +785,13 @@
788786 }
789787 }
790788
791 - public function getFullUrl() {
 789+ public function getFullUrl( $commentId = '' ) {
792790 $title = SpecialPage::getTitleFor( 'Code', $this->mRepo->getName() . '/' . $this->mId );
 791+
 792+ if ( $commentId !== '' ) {
 793+ $title->setFragment( "#c{$commentId}" );
 794+ }
 795+
793796 return $title->getFullUrl();
794797 }
795798
@@ -797,9 +800,7 @@
798801
799802 if( $wgCodeReviewUDPAddress ) {
800803 if( is_null( $url ) ) {
801 - $title = SpecialPage::getTitleFor( 'Code', $this->mRepo->getName() . '/' . $this->mId );
802 - $title->setFragment( "#c{$commentId}" );
803 - $url = $title->getFullUrl();
 804+ $url = $this->getFullUrl( $commentId );
804805 }
805806
806807 $line = wfMsg( 'code-rev-message' ) . " \00314(" . $this->mRepo->getName() .
@@ -814,8 +815,7 @@
815816 global $wgCodeReviewUDPAddress, $wgCodeReviewUDPPort, $wgCodeReviewUDPPrefix, $wgUser;
816817
817818 if( $wgCodeReviewUDPAddress ) {
818 - $title = SpecialPage::getTitleFor( 'Code', $this->mRepo->getName() . '/' . $this->getId() );
819 - $url = $title->getFullUrl();
 819+ $url = $this->getFullUrl();
820820
821821 $line = wfMsg( 'code-rev-status' ) . " \00314(" . $this->mRepo->getName() .
822822 ")\00303 " . RecentChange::cleanupForIRC( $wgUser->getName() ) . "\003 " .

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r71208Add getFullUrl function as minor followup to r71207reedy18:47, 17 August 2010

Status & tagging log