X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FCategoryViewer.php;h=4027bef09f62791d710086ba07a5b8939455e249;hb=af7a22b77132b498daa78ed92177a26e52b2f571;hp=5b6694fb0a7874c77b0caa8713605f65377cd8cd;hpb=e0c17dd8599dfc78957201563e933d2dfe19da48;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/CategoryViewer.php b/includes/CategoryViewer.php index 5b6694fb0a..4027bef09f 100644 --- a/includes/CategoryViewer.php +++ b/includes/CategoryViewer.php @@ -181,15 +181,6 @@ class CategoryViewer extends ContextSource { $this->getSubcategorySortChar( $cat->getTitle(), $sortkey ); } - /** - * Add a subcategory to the internal lists, using a title object - * @deprecated since 1.17 kept for compatibility, use addSubcategoryObject instead - */ - function addSubcategory( Title $title, $sortkey, $pageLength ) { - wfDeprecated( __METHOD__, '1.17' ); - $this->addSubcategoryObject( Category::newFromTitle( $title ), $sortkey, $pageLength ); - } - /** * Get the character to be used for sorting subcategories. * If there's a link from Category:A to Category:B, the sortkey of the resulting @@ -660,20 +651,20 @@ class CategoryViewer extends ContextSource { * @param int $rescnt The number of items returned by our database query. * @param int $dbcnt The number of items according to the category table. * @param string $type 'subcat', 'article', or 'file' - * @return String: A message giving the number of items, to output to HTML. + * @return string: A message giving the number of items, to output to HTML. */ private function getCountMessage( $rescnt, $dbcnt, $type ) { - # There are three cases: - # 1) The category table figure seems sane. It might be wrong, but - # we can't do anything about it if we don't recalculate it on ev- - # ery category view. - # 2) The category table figure isn't sane, like it's smaller than the - # number of actual results, *but* the number of results is less - # than $this->limit and there's no offset. In this case we still - # know the right figure. - # 3) We have no idea. - - # Check if there's a "from" or "until" for anything + // There are three cases: + // 1) The category table figure seems sane. It might be wrong, but + // we can't do anything about it if we don't recalculate it on ev- + // ery category view. + // 2) The category table figure isn't sane, like it's smaller than the + // number of actual results, *but* the number of results is less + // than $this->limit and there's no offset. In this case we still + // know the right figure. + // 3) We have no idea. + + // Check if there's a "from" or "until" for anything // This is a little ugly, but we seem to use different names // for the paging types then for the messages. @@ -693,23 +684,22 @@ class CategoryViewer extends ContextSource { if ( $dbcnt == $rescnt || ( ( $rescnt == $this->limit || $fromOrUntil ) && $dbcnt > $rescnt ) ) { - # Case 1: seems sane. + // Case 1: seems sane. $totalcnt = $dbcnt; } elseif ( $rescnt < $this->limit && !$fromOrUntil ) { - # Case 2: not sane, but salvageable. Use the number of results. - # Since there are fewer than 200, we can also take this opportunity - # to refresh the incorrect category table entry -- which should be - # quick due to the small number of entries. + // Case 2: not sane, but salvageable. Use the number of results. + // Since there are fewer than 200, we can also take this opportunity + // to refresh the incorrect category table entry -- which should be + // quick due to the small number of entries. $totalcnt = $rescnt; $this->cat->refreshCounts(); } else { - # Case 3: hopeless. Don't give a total count at all. - # Give grep a chance to find the usages: category-subcat-count-limited, - # category-article-count-limited, category-file-count-limited + // Case 3: hopeless. Don't give a total count at all. + // Messages: category-subcat-count-limited, category-article-count-limited, + // category-file-count-limited return $this->msg( "category-$type-count-limited" )->numParams( $rescnt )->parseAsBlock(); } - # Give grep a chance to find the usages: - # category-subcat-count, category-article-count, category-file-count + // Messages: category-subcat-count, category-article-count, category-file-count return $this->msg( "category-$type-count" )->numParams( $rescnt, $totalcnt )->parseAsBlock(); } }