Index: trunk/phase3/includes/CategoryPage.php |
— | — | @@ -11,6 +11,9 @@ |
12 | 12 | /** |
13 | 13 | */ |
14 | 14 | class CategoryPage extends Article { |
| 15 | + # Subclasses can change this to override the viewer class. |
| 16 | + protected $mCategoryViewerClass = 'CategoryViewer'; |
| 17 | + |
15 | 18 | function view() { |
16 | 19 | global $wgRequest, $wgUser; |
17 | 20 | |
— | — | @@ -62,7 +65,7 @@ |
63 | 66 | $until[$type] = isset( $_GET["{$type}until"] ) ? $_GET["{$type}until"] : null; |
64 | 67 | } |
65 | 68 | |
66 | | - $viewer = new CategoryViewer( $this->mTitle, $from, $until, $_GET ); |
| 69 | + $viewer = new $this->mCategoryViewerClass( $this->mTitle, $from, $until, $_GET ); |
67 | 70 | $wgOut->addHTML( $viewer->getHTML() ); |
68 | 71 | } |
69 | 72 | } |
Index: trunk/extensions/PeopleCategories/PeopleCategories.body.php |
— | — | @@ -8,6 +8,8 @@ |
9 | 9 | */ |
10 | 10 | |
11 | 11 | class PeopleCategoriesPage extends CategoryPage { |
| 12 | + protected $mCategoryViewerClass = 'PeopleCategoriesViewer'; |
| 13 | + |
12 | 14 | function view() { |
13 | 15 | // From CategoryPage::view() |
14 | 16 | if( NS_CATEGORY == $this->mTitle->getNamespace() ) { |
— | — | @@ -21,19 +23,6 @@ |
22 | 24 | $this->closeShowCategory(); |
23 | 25 | } |
24 | 26 | } |
25 | | - |
26 | | - function closeShowCategory() { |
27 | | - // From CategoryPage::view(); |
28 | | - global $wgOut, $wgRequest; |
29 | | - $from = $wgRequest->getVal( 'from' ); |
30 | | - $until = $wgRequest->getVal( 'until' ); |
31 | | - |
32 | | - // Customization. |
33 | | - $viewer = new PeopleCategoriesViewer( $this->mTitle, $from, $until ); |
34 | | - |
35 | | - // From CategoryPage::view(); |
36 | | - $wgOut->addHTML( $viewer->getHTML() ); |
37 | | - } |
38 | 27 | } |
39 | 28 | |
40 | 29 | class PeopleCategoriesViewer extends CategoryViewer { |
Index: trunk/extensions/CategoryTree/CategoryPageSubclass.php |
— | — | @@ -1,15 +1,7 @@ |
2 | 2 | <?php |
3 | 3 | |
4 | 4 | class CategoryTreeCategoryPage extends CategoryPage { |
5 | | - function closeShowCategory() { |
6 | | - global $wgOut, $wgRequest; |
7 | | - |
8 | | - $from = $wgRequest->getVal( 'from' ); |
9 | | - $until = $wgRequest->getVal( 'until' ); |
10 | | - |
11 | | - $viewer = new CategoryTreeCategoryViewer( $this->mTitle, $from, $until ); |
12 | | - $wgOut->addHTML( $viewer->getHTML() ); |
13 | | - } |
| 5 | + protected $mCategoryViewerClass = 'CategoryTreeCategoryViewer'; |
14 | 6 | } |
15 | 7 | |
16 | 8 | class CategoryTreeCategoryViewer extends CategoryViewer { |
Index: trunk/extensions/MetavidWiki/includes/articlepages/MV_CategoryPage.php |
— | — | @@ -16,13 +16,7 @@ |
17 | 17 | if ( !defined( 'MEDIAWIKI' ) ) die( 1 ); |
18 | 18 | |
19 | 19 | class MV_CategoryPage extends CategoryPage { |
20 | | - function closeShowCategory() { |
21 | | - global $wgOut, $wgRequest; |
22 | | - $from = $wgRequest->getVal( 'from' ); |
23 | | - $until = $wgRequest->getVal( 'until' ); |
24 | | - $viewer = new MvCategoryViewer( $this->mTitle, $from, $until ); |
25 | | - $wgOut->addHTML( $viewer->getHTML() ); |
26 | | - } |
| 20 | + protected $mCategoryViewerClass = 'MvCategoryViewer'; |
27 | 21 | } |
28 | 22 | class MvCategoryViewer extends CategoryViewer { |
29 | 23 | var $show_mv_links = false; |