Index: trunk/extensions/CodeReview/SpecialCode.php |
— | — | @@ -132,6 +132,11 @@ |
133 | 133 | |
134 | 134 | function execute() { |
135 | 135 | global $wgOut; |
| 136 | + if( !$this->mRepo ) { |
| 137 | + $view = new CodeRepoListView(); |
| 138 | + $view->execute(); |
| 139 | + return; |
| 140 | + } |
136 | 141 | $pager = new SvnRevTablePager( $this ); |
137 | 142 | $wgOut->addHtml( $pager->getBody() . $pager->getNavigationBar() ); |
138 | 143 | } |
— | — | @@ -175,7 +180,9 @@ |
176 | 181 | switch( $name ){ |
177 | 182 | case 'cr_id': |
178 | 183 | global $wgUser; |
179 | | - return $wgUser->getSkin()->link( SpecialPage::getTitleFor( 'Code', $this->mRepo->getName() . '/' . $value ), htmlspecialchars( $value ) ); |
| 184 | + return $wgUser->getSkin()->link( |
| 185 | + SpecialPage::getTitleFor( 'Code', $this->mRepo->getName() . '/' . $value ), htmlspecialchars( $value ) |
| 186 | + ); |
180 | 187 | case 'cr_author': |
181 | 188 | return $this->mView->authorLink( $value ); |
182 | 189 | case 'cr_message': |
— | — | @@ -197,12 +204,18 @@ |
198 | 205 | function __construct( $repoName, $rev ){ |
199 | 206 | parent::__construct(); |
200 | 207 | $this->mRepo = CodeRepository::newFromName( $repoName ); |
201 | | - $this->mRev = $this->mRepo->getRevision( intval( $rev ) ); |
| 208 | + $this->mRev = $this->mRepo ? $this->mRepo->getRevision( intval( $rev ) ) : null; |
202 | 209 | } |
203 | 210 | |
204 | 211 | function execute(){ |
205 | 212 | global $wgOut, $wgUser; |
206 | | - $repoLink = $wgUser->getSkin()->link( SpecialPage::getTitleFor( 'Code', $this->mRepo->getName() ), htmlspecialchars( $this->mRepo->getName() ) ); |
| 213 | + if( !$this->mRepo || $this->mRev ) { |
| 214 | + $view = new CodeRepoListView(); |
| 215 | + $view->execute(); |
| 216 | + return; |
| 217 | + } |
| 218 | + $repoLink = $wgUser->getSkin()->link( SpecialPage::getTitleFor( 'Code', $this->mRepo->getName() ), |
| 219 | + htmlspecialchars( $this->mRepo->getName() ) ); |
207 | 220 | $rev = $this->mRev->getId(); |
208 | 221 | $revText = htmlspecialchars( $rev ); |
209 | 222 | $viewvc = $this->mRepo->getViewVcBase(); |