categorytree ) ) { CategoryTree::setHeaders( $this->getOutput() ); $options = $this->getConfig()->get( 'CategoryTreeCategoryPageOptions' ); $mode = $this->getRequest()->getRawVal( 'mode' ); if ( $mode !== null ) { $options['mode'] = CategoryTree::decodeMode( $mode ); } $this->categorytree = new CategoryTree( $options ); } return $this->categorytree; } /** * Add a subcategory to the internal lists * @param Category $cat * @param string $sortkey * @param int $pageLength */ public function addSubcategoryObject( Category $cat, $sortkey, $pageLength ) { $title = $cat->getTitle(); if ( $this->getRequest()->getCheck( 'notree' ) ) { parent::addSubcategoryObject( $cat, $sortkey, $pageLength ); return; } $tree = $this->getCategoryTree(); $this->children[] = $tree->renderNodeInfo( $title, $cat ); $this->children_start_char[] = $this->getSubcategorySortChar( $title, $sortkey ); } /** * @inheritDoc */ public function clearCategoryState() { $this->child_cats = []; parent::clearCategoryState(); } /** * @inheritDoc */ public function finaliseCategoryState() { if ( $this->flip ) { $this->child_cats = array_reverse( $this->child_cats ); } parent::finaliseCategoryState(); } }