getVal( 'from' ); $until = $wgRequest->getVal( 'until' ); $viewer = new CategoryTreeCategoryViewer( $this->mTitle, $from, $until ); $wgOut->addHTML( $viewer->getHTML() ); } } class CategoryTreeCategoryViewer extends CategoryViewer { var $child_titles; /** * Add a subcategory to the internal lists */ function addSubcategory( $title, $sortkey, $pageLength ) { global $wgContLang, $wgOut, $wgRequest; if ( $wgRequest->getCheck( 'notree' ) ) { return parent::addSubcategory( $title, $sortkey, $pageLength ); } if ( ! $GLOBALS['wgCategoryTreeUnifiedView'] ) { $this->child_titles[] = $title; return parent::addSubcategory( $title, $sortkey, $pageLength ); } if ( ! isset($this->categorytree) ) { CategoryTree::setHeaders( $wgOut ); $this->categorytree = new CategoryTree; } $this->children[] = $this->categorytree->renderNode( $title ); $this->children_start_char[] = $this->getSubcategorySortChar( $title, $sortkey ); } function getSubcategorySection() { global $wgOut, $wgRequest, $wgCookiePrefix; if ( $wgRequest->getCheck( 'notree' ) ) { return parent::getSubcategorySection(); } if ( $GLOBALS['wgCategoryTreeUnifiedView'] ) { return parent::getSubcategorySection(); } if( count( $this->children ) == 0 ) { return ''; } $r = '
' . $this->makeShowAsLink( 'tree', $showAs ) . ' | ' . $this->makeShowAsLink( 'list', $showAs ) . '
'; } if ( $showAs == 'list' ) { $r .= $this->formatList( $this->children, $this->children_start_char ); } else { CategoryTree::setHeaders( $wgOut ); $ct = new CategoryTree; foreach ( $this->child_titles as $title ) { $r .= $ct->renderNode( $title ); } } return $r; } function makeShowAsLink( $targetValue, $currentValue ) { $msg = htmlspecialchars( CategoryTree::msg( "show-$targetValue" ) ); if ( $targetValue == $currentValue ) { return "$msg"; } else { return $this->getSkin()->makeKnownLinkObj( $this->title, $msg, "showas=$targetValue" ); } } function clearCategoryState() { $this->child_titles = array(); parent::clearCategoryState(); } function finaliseCategoryState() { if( $this->flip ) { $this->child_titles = array_reverse( $this->child_titles ); } parent::finaliseCategoryState(); } } ?>