r103315 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r103314‎ | r103315 | r103316 >
Date:12:35, 16 November 2011
Author:bawolff
Status:ok
Tags:
Comment:
(follow-up r103260) fix if condition per Umherirrender, change variable name to something less confusing per Nikerabbit.
Modified paths:
  • /trunk/extensions/CategoryTree/CategoryTreeFunctions.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CategoryTree/CategoryTreeFunctions.php
@@ -593,9 +593,9 @@
594594 $attr = array( 'class' => 'CategoryTreeBullet' );
595595
596596 # Get counts, with conversion to integer so === works
597 - # Note: $pageCount is the total number of cat members,
 597+ # Note: $allCount is the total number of cat members,
598598 # not the count of how many members are normal pages.
599 - $pageCount = $cat ? intval( $cat->getPageCount() ) : 0;
 599+ $allCount = $cat ? intval( $cat->getPageCount() ) : 0;
600600 $subcatCount = $cat ? intval( $cat->getSubcatCount() ) : 0;
601601 $fileCount = $cat ? intval( $cat->getFileCount() ) : 0;
602602
@@ -605,9 +605,9 @@
606606 if ( $mode == CT_MODE_CATEGORIES ) {
607607 $count = $subcatCount;
608608 } elseif ( $mode == CT_MODE_PAGES ) {
609 - $count = $pageCount - $fileCount;
 609+ $count = $allCount - $fileCount;
610610 } else {
611 - $count = $pageCount;
 611+ $count = $allCount;
612612 }
613613 }
614614 if ( $count === 0 ) {
@@ -650,11 +650,11 @@
651651 $s .= Xml::openElement( 'a', array( 'class' => $labelClass, 'href' => $wikiLink ) ) . $label . Xml::closeElement( 'a' );
652652
653653 if ( $count !== false && $this->getOption( 'showcount' ) ) {
654 - $pages = $pageCount - $subcatCount - $fileCount;
 654+ $pages = $allCount - $subcatCount - $fileCount;
655655
656656 global $wgContLang, $wgLang;
657657 $attr = array(
658 - 'title' => wfMsgExt( 'categorytree-member-counts', 'parsemag', $subcatCount, $pages , $fileCount, $pageCount, $count ),
 658+ 'title' => wfMsgExt( 'categorytree-member-counts', 'parsemag', $subcatCount, $pages , $fileCount, $allCount, $count ),
659659 'dir' => $wgLang->getDir() # numbers and commas get messed up in a mixed dir env
660660 );
661661
@@ -665,7 +665,7 @@
666666 if ( $subcatCount ) {
667667 $memberNums[] = wfMessage( 'categorytree-num-categories', $wgLang->formatNum( $subcatCount ) )->text();
668668 }
669 - if ( $pageCount ) {
 669+ if ( $pages ) {
670670 $memberNums[] = wfMessage( 'categorytree-num-pages', $wgLang->formatNum( $pages ) )->text();
671671 }
672672 if ( $fileCount ) {
@@ -683,7 +683,7 @@
684684 $subcatCount,
685685 $pages,
686686 $fileCount,
687 - $pageCount,
 687+ $allCount,
688688 $memberNumsShort ) );
689689 }
690690

Follow-up revisions

RevisionCommit summaryAuthorDate
r106667Narayam and WebFonts to trunk state...nikerabbit18:16, 19 December 2011
r107970MFT r100516, r103260, r103315, r103378, r103382, r104862reedy00:08, 4 January 2012

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r103260(follow-up r100023; bug 32438) $pagesCount is total number of members a categ...bawolff23:35, 15 November 2011

Status & tagging log