http://www.mediawiki.org/wiki/Special:Code/MediaWiki/88586

Revision: 88586
Author:   reedy
Date:     2011-05-22 17:57:15 +0000 (Sun, 22 May 2011)
Log Message:
-----------
Less Special hardcoding

Modified Paths:
--------------
    trunk/extensions/CodeReview/ui/CodeRepoListView.php

Modified: trunk/extensions/CodeReview/ui/CodeRepoListView.php
===================================================================
--- trunk/extensions/CodeReview/ui/CodeRepoListView.php 2011-05-22 17:46:19 UTC 
(rev 88585)
+++ trunk/extensions/CodeReview/ui/CodeRepoListView.php 2011-05-22 17:57:15 UTC 
(rev 88586)
@@ -37,29 +37,31 @@
        public static function getNavItem( $repo ) {
                global $wgLang, $wgUser;
                $name = $repo->getName();
-               $links[] = "[[Special:Code/$name/comments|" . wfMsgHtml( 
'code-notes' ) . "]]";
-               $links[] = "[[Special:Code/$name/statuschanges|" . wfMsgHtml( 
'code-statuschanges' ) . "]]";
+
+               $code = SpecialPage::getTitleFor( 'Code', $name );
+               $links[] = "[[$code/comments|" . wfMsgHtml( 'code-notes' ) . 
"]]";
+               $links[] = "[[$code/statuschanges|" . wfMsgHtml( 
'code-statuschanges' ) . "]]";
                if ( $wgUser->getId() ) {
                        $author = $repo->wikiUserAuthor( $wgUser->getName() );
                        if ( $author !== false ) {
-                               $links[] = 
"[[Special:Code/$name/author/$author|" . wfMsgHtml( 'code-mycommits' ) . "]]";
+                               $links[] = "[[$code/author/$author|" . 
wfMsgHtml( 'code-mycommits' ) . "]]";
                        }
                }
 
                if ( $wgUser->isAllowed( 'codereview-post-comment' ) ) {
                        $userName = $wgUser->getName();
-                       $links[] = 
"[[Special:Code/$name/comments/author/$userName|" . wfMsgHtml( 
'code-mycomments' ) . "]]";
+                       $links[] = "[[$code/comments/author/$userName|" . 
wfMsgHtml( 'code-mycomments' ) . "]]";
                }
 
-               $links[] = "[[Special:Code/$name/tag|" . wfMsgHtml( 'code-tags' 
) . "]]";
-               $links[] = "[[Special:Code/$name/author|" . wfMsgHtml( 
'code-authors' ) . "]]";
-               $links[] = "[[Special:Code/$name/status|" . wfMsgHtml( 
'code-status' ) . "]]";
-               $links[] = "[[Special:Code/$name/releasenotes|" . wfMsgHtml( 
'code-releasenotes' ) . "]]";
-               $links[] = "[[Special:Code/$name/stats|" . wfMsgHtml( 
'code-stats' ) . "]]";
+               $links[] = "[[$code/tag|" . wfMsgHtml( 'code-tags' ) . "]]";
+               $links[] = "[[$code/author|" . wfMsgHtml( 'code-authors' ) . 
"]]";
+               $links[] = "[[$code/status|" . wfMsgHtml( 'code-status' ) . 
"]]";
+               $links[] = "[[$code/releasenotes|" . wfMsgHtml( 
'code-releasenotes' ) . "]]";
+               $links[] = "[[$code/stats|" . wfMsgHtml( 'code-stats' ) . "]]";
                if( $wgUser->isAllowed( 'repoadmin' ) ) {
                        $links[] = "[[Special:RepoAdmin/$name|" . wfMsgHtml( 
'repoadmin-nav' ) . "]]";
                }
-               $text = "'''[[Special:Code/$name|$name]]''' " . wfMsg( 
'parentheses', $wgLang->pipeList( $links ) );
+               $text = "'''[[$code|$name]]''' " . wfMsg( 'parentheses', 
$wgLang->pipeList( $links ) );
                return $text;
        }
 }


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to