r47049 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r47048‎ | r47049 | r47050 >
Date:19:28, 9 February 2009
Author:siebrand
Status:ok
Tags:
Comment:
Remove code that has been commented out since r36815.
Modified paths:
  • /trunk/extensions/CategoryTree/CategoryPageSubclass.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CategoryTree/CategoryPageSubclass.php
@@ -50,86 +50,6 @@
5151 $this->children_start_char[] = $this->getSubcategorySortChar( $title, $sortkey );
5252 }
5353
54 - /*
55 - # this is a pain to keep this consistent, and no one should be using wgCategoryTreeUnifiedView = false anyway.
56 - function getSubcategorySection() {
57 - global $wgOut, $wgRequest, $wgCookiePrefix;
58 -
59 - if ( $wgRequest->getCheck( 'notree' ) ) {
60 - return parent::getSubcategorySection();
61 - }
62 -
63 - if ( $GLOBALS['wgCategoryTreeUnifiedView'] ) {
64 - return parent::getSubcategorySection();
65 - }
66 -
67 - if( count( $this->children ) == 0 ) {
68 - return '';
69 - }
70 -
71 - $r = '<h2>' . wfMsg( 'subcategories' ) . "</h2>\n" .
72 - wfMsgExt( 'subcategorycount', array( 'parse' ), count( $this->children) );
73 -
74 - # Use a cookie to save the user's last selection, so that AJAX doesn't
75 - # keep coming back to haunt them.
76 - #
77 - # FIXME: This doesn't work very well with IMS handling in
78 - # OutputPage::checkLastModified, because when the cookie changes, the
79 - # category pages are not, at present, invalidated.
80 - $cookieName = $wgCookiePrefix.'ShowSubcatAs';
81 - $cookieVal = @$_COOKIE[$cookieName];
82 - $reqShowAs = $wgRequest->getVal( 'showas' );
83 - if ( $reqShowAs == 'list' ) {
84 - $showAs = 'list';
85 - } elseif ( $reqShowAs == 'tree' ) {
86 - $showAs = 'tree';
87 - } elseif ( $cookieVal == 'list' || $cookieVal == 'tree' ) {
88 - $showAs = $cookieVal;
89 - } else {
90 - $showAs = 'tree';
91 - }
92 -
93 - if ( !is_null( $reqShowAs ) ) {
94 - global $wgCookieExpiration, $wgCookiePath, $wgCookieDomain, $wgCookieSecure;
95 - $exp = time() + $wgCookieExpiration;
96 - setcookie( $cookieName, $showAs, $exp, $wgCookiePath, $wgCookieDomain, $wgCookieSecure );
97 - }
98 -
99 - if ( $showAs == 'tree' && count( $this->children ) > $this->limit ) {
100 - # Tree doesn't page properly
101 - $showAs = 'list';
102 - $r .= self::msg( 'too-many-subcats' );
103 - } else {
104 - $sk = $this->getSkin();
105 - $r .= '<p>' .
106 - $this->makeShowAsLink( 'tree', $showAs ) .
107 - ' | ' .
108 - $this->makeShowAsLink( 'list', $showAs ) .
109 - '</p>';
110 - }
111 -
112 - if ( $showAs == 'list' ) {
113 - $r .= $this->formatList( $this->children, $this->children_start_char );
114 - } else {
115 - $ct = $this->getCategoryTree();
116 -
117 - foreach ( $this->child_cats as $cat ) {
118 - $r .= $ct->renderNodeInfo( $cat->getTitle(), $cat );
119 - }
120 - }
121 - return $r;
122 - }
123 -
124 - function makeShowAsLink( $targetValue, $currentValue ) {
125 - $msg = htmlspecialchars( CategoryTree::msg( "show-$targetValue" ) );
126 -
127 - if ( $targetValue == $currentValue ) {
128 - return "<strong>$msg</strong>";
129 - } else {
130 - return $this->getSkin()->makeKnownLinkObj( $this->title, $msg, "showas=$targetValue" );
131 - }
132 - } */
133 -
13454 function clearCategoryState() {
13555 $this->child_cats = array();
13656 parent::clearCategoryState();

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r36815Show member counts in category tree. Requires r36814 of Category.php and Cate...daniel14:09, 30 June 2008

Status & tagging log