setHeaders(); $this->outputHeader(); $cats = ( new CategoryManager() )->getVisibleCategories(); if ( in_array( $par, $cats ) ) { $this->category = $par; } if ( !$this->category ) { $this->addHelpLink( 'Help:Extension:Linter' ); $this->showCategoryList( $cats ); } else { $this->addHelpLink( "Help:Extension:Linter/{$this->category}" ); $out = $this->getOutput(); $out->setPageTitle( $this->msg( 'linterrors-subpage', $this->msg( "linter-category-{$this->category}" )->text() ) ); $out->addBacklinkSubtitle( $this->getPageTitle() ); $out->addWikiMsg( "linter-category-{$this->category}-desc" ); $pager = new LintErrorsPager( $this->getContext(), $this->category, $this->getLinkRenderer() ); $out->addParserOutput( $pager->getFullOutput() ); } } private function showCategoryList( array $cats ) { $linkRenderer = $this->getLinkRenderer(); $html = Html::openElement( 'ul' ) . "\n"; sort( $cats ); foreach ( $cats as $cat ) { $html .= Html::rawElement( 'li', [], $linkRenderer->makeKnownLink( $this->getPageTitle( $cat ), $this->msg( "linter-category-$cat" )->text() ) ) . "\n"; } $html .= Html::closeElement( 'ul' ); $this->getOutput()->addHTML( $html ); } public function getGroupName() { return 'maintenance'; } }