Public Member Functions | |
__construct ($title, $from= '', $until= '') | |
getHTML () | |
Format the category data list. | |
clearCategoryState () | |
getSkin () | |
addSubcategoryObject ($cat, $sortkey, $pageLength) | |
Add a subcategory to the internal lists, using a Category object. | |
addSubcategory ($title, $sortkey, $pageLength) | |
Add a subcategory to the internal lists, using a title object. | |
getSubcategorySortChar ($title, $sortkey) | |
Get the character to be used for sorting subcategories. | |
addImage (Title $title, $sortkey, $pageLength, $isRedirect=false) | |
Add a page in the image namespace. | |
addPage ($title, $sortkey, $pageLength, $isRedirect=false) | |
Add a miscellaneous page. | |
finaliseCategoryState () | |
doCategoryQuery () | |
getCategoryTop () | |
getSubcategorySection () | |
getPagesSection () | |
getImageSection () | |
getCategoryBottom () | |
Public Attributes | |
$title | |
$limit | |
$from | |
$until | |
$articles | |
$articles_start_char | |
$children | |
$children_start_char | |
$showGallery | |
$gallery | |
$skin | |
Private Member Functions | |
formatList ($articles, $articles_start_char, $cutoff=6) | |
Format a list of articles chunked by letter, either as a bullet list or a columnar format, depending on the length. | |
columnList ($articles, $articles_start_char) | |
Format a list of articles chunked by letter in a three-column list, ordered vertically. | |
shortList ($articles, $articles_start_char) | |
Format a list of articles chunked by letter in a bullet list. | |
pagingLinks ($title, $first, $last, $limit, $query=array()) | |
getCountMessage ($rescnt, $dbcnt, $type) | |
What to do if the category table conflicts with the number of results returned? This function says what. | |
Private Attributes | |
$cat | |
Category object for this page. |
Definition at line 63 of file CategoryPage.php.
CategoryViewer::__construct | ( | $ | title, | |
$ | from = '' , |
|||
$ | until = '' | |||
) |
Definition at line 72 of file CategoryPage.php.
References $from, $title, $until, $wgCategoryPagingLimit, and Category::newFromTitle().
CategoryViewer::addImage | ( | Title $ | title, | |
$ | sortkey, | |||
$ | pageLength, | |||
$ | isRedirect = false | |||
) |
Add a page in the image namespace.
Definition at line 189 of file CategoryPage.php.
References addPage().
Referenced by doCategoryQuery().
CategoryViewer::addPage | ( | $ | title, | |
$ | sortkey, | |||
$ | pageLength, | |||
$ | isRedirect = false | |||
) |
Add a miscellaneous page.
Definition at line 204 of file CategoryPage.php.
References $title, $wgContLang, and getSkin().
Referenced by addImage(), and doCategoryQuery().
CategoryViewer::addSubcategory | ( | $ | title, | |
$ | sortkey, | |||
$ | pageLength | |||
) |
Add a subcategory to the internal lists, using a title object.
Definition at line 154 of file CategoryPage.php.
References $title, getSkin(), and getSubcategorySortChar().
Referenced by addSubcategoryObject().
CategoryViewer::addSubcategoryObject | ( | $ | cat, | |
$ | sortkey, | |||
$ | pageLength | |||
) |
Add a subcategory to the internal lists, using a Category object.
Definition at line 145 of file CategoryPage.php.
References $cat, $title, and addSubcategory().
Referenced by doCategoryQuery().
CategoryViewer::clearCategoryState | ( | ) |
CategoryViewer::columnList | ( | $ | articles, | |
$ | articles_start_char | |||
) | [private] |
Format a list of articles chunked by letter in a three-column list, ordered vertically.
TODO: Take the headers into account when creating columns, so they're more visually equal.
More distant TODO: Scrap this and use CSS columns, whenever IE finally supports those.
$articles | Array | |
$articles_start_char | Array |
Definition at line 386 of file CategoryPage.php.
References $articles, $articles_start_char, $columns, and wfMsgHtml().
Referenced by formatList().
CategoryViewer::doCategoryQuery | ( | ) |
Definition at line 228 of file CategoryPage.php.
References $cat, $dbr, $res, $title, addImage(), addPage(), addSubcategoryObject(), Title::makeTitle(), Category::newFromRow(), and wfGetDB().
Referenced by getHTML().
CategoryViewer::finaliseCategoryState | ( | ) |
CategoryViewer::formatList | ( | $ | articles, | |
$ | articles_start_char, | |||
$ | cutoff = 6 | |||
) | [private] |
Format a list of articles chunked by letter, either as a bullet list or a columnar format, depending on the length.
$articles | Array | |
$articles_start_char | Array | |
$cutoff | Int |
Definition at line 361 of file CategoryPage.php.
References $articles, $articles_start_char, columnList(), and shortList().
Referenced by getPagesSection(), and getSubcategorySection().
CategoryViewer::getCategoryBottom | ( | ) |
Definition at line 341 of file CategoryPage.php.
References pagingLinks().
Referenced by getCategoryTop(), and getHTML().
CategoryViewer::getCategoryTop | ( | ) |
Definition at line 278 of file CategoryPage.php.
References getCategoryBottom().
Referenced by getHTML().
CategoryViewer::getCountMessage | ( | $ | rescnt, | |
$ | dbcnt, | |||
$ | type | |||
) | [private] |
What to do if the category table conflicts with the number of results returned? This function says what.
It works the same whether the things being counted are articles, subcategories, or files.
Note for grepping: uses the messages category-article-count, category-article-count-limited, category-subcat-count, category-subcat-count-limited, category-file-count, category-file-count-limited.
$rescnt | Int: The number of items returned by our database query. | |
$dbcnt | Int: The number of items according to the category table. | |
$type | String: 'subcat', 'article', or 'file' |
Definition at line 512 of file CategoryPage.php.
References $wgLang, and wfMsgExt().
Referenced by getImageSection(), getPagesSection(), and getSubcategorySection().
CategoryViewer::getHTML | ( | ) |
Format the category data list.
Definition at line 87 of file CategoryPage.php.
References $wgCategoryMagicGallery, $wgCategoryPagingLimit, $wgContLang, $wgOut, clearCategoryState(), doCategoryQuery(), finaliseCategoryState(), getCategoryBottom(), getCategoryTop(), getImageSection(), getPagesSection(), getSubcategorySection(), wfMsgExt(), wfProfileIn(), and wfProfileOut().
CategoryViewer::getImageSection | ( | ) |
Definition at line 327 of file CategoryPage.php.
References getCountMessage(), and wfMsg().
Referenced by getHTML().
CategoryViewer::getPagesSection | ( | ) |
Definition at line 303 of file CategoryPage.php.
References formatList(), getCountMessage(), and wfMsg().
Referenced by getHTML().
CategoryViewer::getSkin | ( | ) |
Definition at line 134 of file CategoryPage.php.
References $wgUser.
Referenced by addPage(), addSubcategory(), and pagingLinks().
CategoryViewer::getSubcategorySection | ( | ) |
Definition at line 285 of file CategoryPage.php.
References formatList(), getCountMessage(), and wfMsg().
Referenced by getHTML().
CategoryViewer::getSubcategorySortChar | ( | $ | title, | |
$ | sortkey | |||
) |
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 entry in the categorylinks table is Category:A, not A, which it SHOULD be. Workaround: If sortkey == "Category:".$title, than use $title for sorting, else use sortkey...
Definition at line 174 of file CategoryPage.php.
References $title, and $wgContLang.
Referenced by addSubcategory().
CategoryViewer::pagingLinks | ( | $ | title, | |
$ | first, | |||
$ | last, | |||
$ | limit, | |||
$ | query = array() | |||
) | [private] |
$title | Title object | |
$first | String | |
$last | String | |
$limit | Int | |
$query | Array: additional query options to pass |
Definition at line 463 of file CategoryPage.php.
References $limit, $title, $wgLang, getSkin(), and wfMsgExt().
Referenced by getCategoryBottom().
CategoryViewer::shortList | ( | $ | articles, | |
$ | articles_start_char | |||
) | [private] |
Format a list of articles chunked by letter in a bullet list.
$articles | Array | |
$articles_start_char | Array |
Definition at line 438 of file CategoryPage.php.
References $articles, and $articles_start_char.
Referenced by formatList().
CategoryViewer::$articles |
Definition at line 64 of file CategoryPage.php.
Referenced by columnList(), formatList(), and shortList().
CategoryViewer::$articles_start_char |
Definition at line 64 of file CategoryPage.php.
Referenced by columnList(), formatList(), and shortList().
CategoryViewer::$cat [private] |
Category object for this page.
Definition at line 70 of file CategoryPage.php.
Referenced by addSubcategoryObject(), and doCategoryQuery().
CategoryViewer::$children |
Definition at line 64 of file CategoryPage.php.
CategoryViewer::$children_start_char |
Definition at line 64 of file CategoryPage.php.
CategoryViewer::$from |
CategoryViewer::$gallery |
Definition at line 64 of file CategoryPage.php.
CategoryViewer::$limit |
CategoryViewer::$showGallery |
Definition at line 64 of file CategoryPage.php.
CategoryViewer::$skin |
Definition at line 64 of file CategoryPage.php.
CategoryViewer::$title |
Definition at line 64 of file CategoryPage.php.
Referenced by __construct(), addPage(), addSubcategory(), addSubcategoryObject(), doCategoryQuery(), getSubcategorySortChar(), and pagingLinks().
CategoryViewer::$until |