r43335 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r43334‎ | r43335 | r43336 >
Date:21:50, 9 November 2008
Author:aaron
Status:old
Tags:
Comment:
Move path stuff up to allow combining author/path filters
Modified paths:
  • /trunk/extensions/CodeReview/CodePathRevListView.php (modified) (history)
  • /trunk/extensions/CodeReview/CodeRevisionListView.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CodeReview/CodePathRevListView.php
@@ -3,16 +3,7 @@
44 // Special:Code/MediaWiki
55 class CodePathRevListView extends CodeRevisionListView {
66 function __construct( $repoName ) {
7 - global $wgRequest;
87 parent::__construct( $repoName );
9 - $this->mRepo = CodeRepository::newFromName( $repoName );
10 - $this->mPath = htmlspecialchars( trim( $wgRequest->getVal( 'path' ) ) );
11 - if( strlen($this->mPath) && $this->mPath[strlen($this->mPath)-1] !== '/' ) {
12 - $this->mPath .= '/'; // make sure this is a dir
13 - }
14 - if( strlen($this->mPath) && $this->mPath[0] !== '/' ) {
15 - $this->mPath = "/{$this->mPath}"; // make sure this is a dir
16 - }
178 }
189
1910 function execute() {
@@ -48,10 +39,6 @@
4940
5041 // Pager for CodeRevisionListView
5142 class SvnPathRevTablePager extends SvnRevTablePager {
52 - function getSVNPath() {
53 - return $this->mView->mPath;
54 - }
55 -
5643 function getTitle() {
5744 return SpecialPage::getTitleFor( 'Code', $this->mRepo->getName() . '/path' );
5845 }
Index: trunk/extensions/CodeReview/CodeRevisionListView.php
@@ -4,9 +4,17 @@
55 class CodeRevisionListView extends CodeView {
66 public $mRepo, $mPath;
77 function __construct( $repoName ) {
 8+ global $wgRequest;
89 parent::__construct();
910 $this->mRepo = CodeRepository::newFromName( $repoName );
10 - $this->mPath = '';
 11+ $this->mPath = htmlspecialchars( trim( $wgRequest->getVal( 'path' ) ) );
 12+ if( strlen($this->mPath) && $this->mPath[strlen($this->mPath)-1] !== '/' ) {
 13+ $this->mPath .= '/'; // make sure this is a dir
 14+ }
 15+ if( strlen($this->mPath) && $this->mPath[0] !== '/' ) {
 16+ $this->mPath = "/{$this->mPath}"; // make sure this is a dir
 17+ }
 18+ $this->mAuthor = null;
1119 }
1220
1321 function execute() {
@@ -28,7 +36,11 @@
2937
3038 function showForm( $path = '' ) {
3139 global $wgOut, $wgScript;
32 - $special = SpecialPage::getTitleFor( 'Code', $this->mRepo->getName().'/path' );
 40+ if( $this->mAuthor ) {
 41+ $special = SpecialPage::getTitleFor( 'Code', $this->mRepo->getName().'/author/'.$this->mAuthor );
 42+ } else {
 43+ $special = SpecialPage::getTitleFor( 'Code', $this->mRepo->getName().'/path' );
 44+ }
3345 $wgOut->addHTML(
3446 Xml::openElement( 'form', array( 'action' => $wgScript, 'method' => 'get' ) ) .
3547 "<fieldset><legend>".wfMsgHtml('code-pathsearch-legend')."</legend>" .
@@ -57,7 +69,7 @@
5870 }
5971
6072 function getSVNPath() {
61 - return false;
 73+ return $this->mView->mPath;
6274 }
6375
6476 function isFieldSortable( $field ) {

Status & tagging log