Fix extensions to work with category sort changes

Three different extensions were copy-pasting all of
CategoryPage::closeShowCategory() just to change which CategoryViewer
descendant was used.  I changed the base class to use a member variable
for the CategoryViewer class, so this reduces code duplication too.  I
only tested this on CategoryTree; MetavidWiki is certainly still broken,
from the looks of it (assumes $this->from is a string), but
PeopleCategories might be okay.  Hard to avoid breaking extensions with
this sort of schema/index change.
This commit is contained in:
Aryeh Gregor 2010-08-13 22:07:48 +00:00
parent a6c63efe65
commit 07ab72b8aa

View file

@ -1,15 +1,7 @@
<?php
class CategoryTreeCategoryPage extends CategoryPage {
function closeShowCategory() {
global $wgOut, $wgRequest;
$from = $wgRequest->getVal( 'from' );
$until = $wgRequest->getVal( 'until' );
$viewer = new CategoryTreeCategoryViewer( $this->mTitle, $from, $until );
$wgOut->addHTML( $viewer->getHTML() );
}
protected $mCategoryViewerClass = 'CategoryTreeCategoryViewer';
}
class CategoryTreeCategoryViewer extends CategoryViewer {