MediaWiki REL1_31
CategoryTreeCategoryViewer.php
Go to the documentation of this file.
1<?php
23
28
32 private function getCategoryTree() {
33 global $wgCategoryTreeCategoryPageOptions;
34
35 if ( !isset( $this->categorytree ) ) {
38 }
39
40 $this->categorytree = new CategoryTree( $wgCategoryTreeCategoryPageOptions );
41 }
42
44 }
45
52 public function addSubcategoryObject( Category $cat, $sortkey, $pageLength ) {
53 $title = $cat->getTitle();
54
55 if ( $this->getRequest()->getCheck( 'notree' ) ) {
56 parent::addSubcategoryObject( $cat, $sortkey, $pageLength );
57 return;
58 }
59
60 $tree = $this->getCategoryTree();
61
62 $this->children[] = $tree->renderNodeInfo( $title, $cat );
63
64 $this->children_start_char[] = $this->getSubcategorySortChar( $title, $sortkey );
65 }
66
67 public function clearCategoryState() {
68 $this->child_cats = [];
69 parent::clearCategoryState();
70 }
71
72 public function finaliseCategoryState() {
73 if ( $this->flip ) {
74 $this->child_cats = array_reverse( $this->child_cats );
75 }
76 parent::finaliseCategoryState();
77 }
78}
addSubcategoryObject(Category $cat, $sortkey, $pageLength)
Add a subcategory to the internal lists.
Core functions for the CategoryTree extension, an AJAX based gadget to display the category structure...
static setHeaders( $outputPage)
Add ResourceLoader modules to the OutputPage object.
Category $cat
Category object for this page.
getSubcategorySortChar( $title, $sortkey)
Get the character to be used for sorting subcategories.
Category objects are immutable, strictly speaking.
Definition Category.php:31