r40932 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r40931‎ | r40932 | r40933 >
Date:20:17, 16 September 2008
Author:brion
Status:old
Tags:
Comment:
Add author-filtered revision list links... fix up paging for tag view
Modified paths:
  • /trunk/extensions/CodeReview/CodeReview.php (modified) (history)
  • /trunk/extensions/CodeReview/CodeRevisionAuthorView.php (added) (history)
  • /trunk/extensions/CodeReview/CodeRevisionTagView.php (modified) (history)
  • /trunk/extensions/CodeReview/SpecialCode.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CodeReview/CodeReview.php
@@ -41,6 +41,7 @@
4242 $wgAutoloadClasses['CodeRepository'] = $dir . 'CodeRepository.php';
4343 $wgAutoloadClasses['CodeRepoListView'] = $dir . 'CodeRepoListView.php';
4444 $wgAutoloadClasses['CodeRevision'] = $dir . 'CodeRevision.php';
 45+$wgAutoloadClasses['CodeRevisionAuthorView'] = $dir . 'CodeRevisionAuthorView.php';
4546 $wgAutoloadClasses['CodeRevisionListView'] = $dir . 'CodeRevisionListView.php';
4647 $wgAutoloadClasses['CodeRevisionTagger'] = $dir . 'CodeRevisionTagger.php';
4748 $wgAutoloadClasses['CodeRevisionTagView'] = $dir . 'CodeRevisionTagView.php';
Index: trunk/extensions/CodeReview/CodeRevisionAuthorView.php
@@ -0,0 +1,30 @@
 2+<?php
 3+
 4+class CodeRevisionAuthorView extends CodeRevisionListView {
 5+ function __construct( $repoName, $author ) {
 6+ parent::__construct( $repoName );
 7+ $this->mAuthor = $author;
 8+ }
 9+
 10+ function getPager() {
 11+ return new SvnRevAuthorTablePager( $this, $this->mAuthor );
 12+ }
 13+}
 14+
 15+class SvnRevAuthorTablePager extends SvnRevTablePager {
 16+ function __construct( $view, $author ) {
 17+ parent::__construct( $view );
 18+ $this->mAuthor = $author;
 19+ }
 20+
 21+ function getQueryInfo() {
 22+ $info = parent::getQueryInfo();
 23+ $info['conds']['cr_author'] = $this->mAuthor; // fixme: normalize input?
 24+ return $info;
 25+ }
 26+
 27+ function getTitle(){
 28+ $repo = $this->mRepo->getName();
 29+ return SpecialPage::getTitleFor( 'Code', "$repo/author/$this->mAuthor" );
 30+ }
 31+}
Property changes on: trunk/extensions/CodeReview/CodeRevisionAuthorView.php
___________________________________________________________________
Added: svn:eol-style
132 + native
Index: trunk/extensions/CodeReview/SpecialCode.php
@@ -29,6 +29,9 @@
3030 if( $params[1] == 'tag' ) {
3131 $view = new CodeRevisionTagView( $params[0], $params[2] );
3232 break;
 33+ } elseif( $params[1] == 'author' ) {
 34+ $view = new CodeRevisionAuthorView( $params[0], $params[2] );
 35+ break;
3336 } else {
3437 throw new MWException( "Unexpected number of parameters" );
3538 }
@@ -69,6 +72,8 @@
7073 abstract function execute();
7174
7275 function authorLink( $author ) {
 76+ /*
 77+ // Leave this for later for now...
7378 static $userLinks = array();
7479 if( isset( $userLinks[$author] ) )
7580 return $userLinks[$author];
@@ -91,6 +96,11 @@
9297 else
9398 $link = htmlspecialchars( $author );
9499 return $userLinks[$author] = $link;
 100+ */
 101+
 102+ $repo = $this->mRepo->getName();
 103+ $special = SpecialPage::getTitleFor( 'Code', "$repo/author/$author" );
 104+ return $this->mSkin->link( $special, htmlspecialchars( $author ) );
95105 }
96106
97107 function formatMessage( $text ){
Index: trunk/extensions/CodeReview/CodeRevisionTagView.php
@@ -25,4 +25,9 @@
2626 $info['conds']['ct_tag'] = $this->mTag; // fixme: normalize input?
2727 return $info;
2828 }
 29+
 30+ function getTitle(){
 31+ $repo = $this->mRepo->getName();
 32+ return SpecialPage::getTitleFor( 'Code', "$repo/tag/$this->mTag" );
 33+ }
2934 }

Status & tagging log