r45520 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r45519‎ | r45520 | r45521 >
Date:21:11, 7 January 2009
Author:btongminh
Status:ok (Comments)
Tags:
Comment:
Add a subtitle for easy navigation
Modified paths:
  • /trunk/extensions/CodeReview/CodeRepoListView.php (modified) (history)
  • /trunk/extensions/CodeReview/CodeReview.i18n.php (modified) (history)
  • /trunk/extensions/CodeReview/SpecialCode.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CodeReview/CodeReview.i18n.php
@@ -75,6 +75,8 @@
7676 'code-rev-submit' => 'Save changes',
7777 'code-rev-submit-next' => 'Save & next unresolved',
7878
 79+ 'codereview-subtitle' => 'For $1',
 80+
7981 'codereview-reply-link' => 'reply',
8082
8183 'codereview-email-subj' => '[$1] [r$2]: New comment added',
Index: trunk/extensions/CodeReview/SpecialCode.php
@@ -78,6 +78,15 @@
7979 }
8080 }
8181 $view->execute();
 82+
 83+ // Add subtitle for easy navigation
 84+ global $wgOut;
 85+ if ( $view instanceof CodeView ) {
 86+ $repo = $view->getRepo();
 87+ if ( $repo )
 88+ $wgOut->setSubtitle( wfMsgExt( 'codereview-subtitle', 'parse',
 89+ CodeRepoListView::getNavItem( $repo->getName() ) ) );
 90+ }
8291 }
8392 }
8493
@@ -144,6 +153,12 @@
145154 }
146155 return $html . "</table>\n";
147156 }
 157+
 158+ function getRepo() {
 159+ if ( $this->mRepo )
 160+ return $this->mRepo;
 161+ return false;
 162+ }
148163 }
149164
150165 class CodeCommentLinker {
Index: trunk/extensions/CodeReview/CodeRepoListView.php
@@ -13,13 +13,18 @@
1414 $text = '';
1515 foreach( $repos as $repo ){
1616 $name = $repo->getName();
17 - $text .= "* '''[[Special:Code/$name|$name]]''' (";
18 - $text .= "[[Special:Code/$name/comments|".wfMsgHtml( 'code-notes' )."]]";
19 - $text .= " | [[Special:Code/$name/tag|".wfMsgHtml( 'code-tags' )."]]";
20 - $text .= " | [[Special:Code/$name/author|".wfMsgHtml( 'code-authors' )."]]";
21 - $text .= ")\n";
 17+ $text .= "* ".self::getNavItem( $name )."\n";
2218 }
2319 $wgOut->addWikiText( $text );
2420 }
 21+
 22+ public static function getNavItem( $name ) {
 23+ $text = "'''[[Special:Code/$name|$name]]''' (";
 24+ $text .= "[[Special:Code/$name/comments|".wfMsgHtml( 'code-notes' )."]]";
 25+ $text .= " | [[Special:Code/$name/tag|".wfMsgHtml( 'code-tags' )."]]";
 26+ $text .= " | [[Special:Code/$name/author|".wfMsgHtml( 'code-authors' )."]]";
 27+ $text .= ")";
 28+ return $text;
 29+ }
2530 }
2631

Comments

#Comment by Brion VIBBER (talk | contribs)   18:50, 13 January 2009

Handy!

Status & tagging log