mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/CategoryTree
synced 2024-11-27 17:51:00 +00:00
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:
parent
a6c63efe65
commit
07ab72b8aa
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue