r88586 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r88585‎ | r88586 | r88587 >
Date:17:57, 22 May 2011
Author:reedy
Status:ok
Tags:
Comment:
Less Special hardcoding
Modified paths:
  • /trunk/extensions/CodeReview/ui/CodeRepoListView.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CodeReview/ui/CodeRepoListView.php
@@ -37,29 +37,31 @@
3838 public static function getNavItem( $repo ) {
3939 global $wgLang, $wgUser;
4040 $name = $repo->getName();
41 - $links[] = "[[Special:Code/$name/comments|" . wfMsgHtml( 'code-notes' ) . "]]";
42 - $links[] = "[[Special:Code/$name/statuschanges|" . wfMsgHtml( 'code-statuschanges' ) . "]]";
 41+
 42+ $code = SpecialPage::getTitleFor( 'Code', $name );
 43+ $links[] = "[[$code/comments|" . wfMsgHtml( 'code-notes' ) . "]]";
 44+ $links[] = "[[$code/statuschanges|" . wfMsgHtml( 'code-statuschanges' ) . "]]";
4345 if ( $wgUser->getId() ) {
4446 $author = $repo->wikiUserAuthor( $wgUser->getName() );
4547 if ( $author !== false ) {
46 - $links[] = "[[Special:Code/$name/author/$author|" . wfMsgHtml( 'code-mycommits' ) . "]]";
 48+ $links[] = "[[$code/author/$author|" . wfMsgHtml( 'code-mycommits' ) . "]]";
4749 }
4850 }
4951
5052 if ( $wgUser->isAllowed( 'codereview-post-comment' ) ) {
5153 $userName = $wgUser->getName();
52 - $links[] = "[[Special:Code/$name/comments/author/$userName|" . wfMsgHtml( 'code-mycomments' ) . "]]";
 54+ $links[] = "[[$code/comments/author/$userName|" . wfMsgHtml( 'code-mycomments' ) . "]]";
5355 }
5456
55 - $links[] = "[[Special:Code/$name/tag|" . wfMsgHtml( 'code-tags' ) . "]]";
56 - $links[] = "[[Special:Code/$name/author|" . wfMsgHtml( 'code-authors' ) . "]]";
57 - $links[] = "[[Special:Code/$name/status|" . wfMsgHtml( 'code-status' ) . "]]";
58 - $links[] = "[[Special:Code/$name/releasenotes|" . wfMsgHtml( 'code-releasenotes' ) . "]]";
59 - $links[] = "[[Special:Code/$name/stats|" . wfMsgHtml( 'code-stats' ) . "]]";
 57+ $links[] = "[[$code/tag|" . wfMsgHtml( 'code-tags' ) . "]]";
 58+ $links[] = "[[$code/author|" . wfMsgHtml( 'code-authors' ) . "]]";
 59+ $links[] = "[[$code/status|" . wfMsgHtml( 'code-status' ) . "]]";
 60+ $links[] = "[[$code/releasenotes|" . wfMsgHtml( 'code-releasenotes' ) . "]]";
 61+ $links[] = "[[$code/stats|" . wfMsgHtml( 'code-stats' ) . "]]";
6062 if( $wgUser->isAllowed( 'repoadmin' ) ) {
6163 $links[] = "[[Special:RepoAdmin/$name|" . wfMsgHtml( 'repoadmin-nav' ) . "]]";
6264 }
63 - $text = "'''[[Special:Code/$name|$name]]''' " . wfMsg( 'parentheses', $wgLang->pipeList( $links ) );
 65+ $text = "'''[[$code|$name]]''' " . wfMsg( 'parentheses', $wgLang->pipeList( $links ) );
6466 return $text;
6567 }
6668 }

Status & tagging log