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 64 of file CategoryPage.php.
CategoryViewer::__construct | ( | $ | title, | |
$ | from = '' , |
|||
$ | until = '' | |||
) |
Definition at line 73 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 175 of file CategoryPage.php.
References addPage().
Referenced by doCategoryQuery().
CategoryViewer::addPage | ( | $ | title, | |
$ | sortkey, | |||
$ | pageLength, | |||
$ | isRedirect = false | |||
) |
Add a miscellaneous page.
Definition at line 190 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 144 of file CategoryPage.php.
References $title, $wgContLang, 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 135 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.
$articles | Array | |
$articles_start_char | Array |
Definition at line 363 of file CategoryPage.php.
References $articles, $articles_start_char, and wfMsgHtml().
Referenced by formatList().
CategoryViewer::doCategoryQuery | ( | ) |
Definition at line 208 of file CategoryPage.php.
References $cat, $count, $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 344 of file CategoryPage.php.
References $articles, $articles_start_char, columnList(), and shortList().
Referenced by getPagesSection(), and getSubcategorySection().
CategoryViewer::getCategoryBottom | ( | ) |
CategoryViewer::getCategoryTop | ( | ) |
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 481 of file CategoryPage.php.
References $wgLang, and wfMsgExt().
Referenced by getImageSection(), getPagesSection(), and getSubcategorySection().
CategoryViewer::getHTML | ( | ) |
Format the category data list.
Definition at line 88 of file CategoryPage.php.
References $wgCategoryMagicGallery, $wgCategoryPagingLimit, $wgOut, clearCategoryState(), doCategoryQuery(), finaliseCategoryState(), getCategoryBottom(), getCategoryTop(), getImageSection(), getPagesSection(), getSubcategorySection(), wfMsgExt(), wfProfileIn(), and wfProfileOut().
CategoryViewer::getImageSection | ( | ) |
Definition at line 310 of file CategoryPage.php.
References getCountMessage(), and wfMsg().
Referenced by getHTML().
CategoryViewer::getPagesSection | ( | ) |
Definition at line 286 of file CategoryPage.php.
References formatList(), getCountMessage(), and wfMsg().
Referenced by getHTML().
CategoryViewer::getSkin | ( | ) |
Definition at line 124 of file CategoryPage.php.
References $wgUser.
Referenced by addPage(), addSubcategory(), and pagingLinks().
CategoryViewer::getSubcategorySection | ( | ) |
Definition at line 269 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 160 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 447 of file CategoryPage.php.
References $limit, $title, $wgLang, getSkin(), wfArrayToCGI(), and wfMsgExt().
Referenced by getCategoryBottom(), and getCategoryTop().
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 422 of file CategoryPage.php.
References $articles, and $articles_start_char.
Referenced by formatList().
CategoryViewer::$articles |
Definition at line 65 of file CategoryPage.php.
Referenced by columnList(), formatList(), and shortList().
CategoryViewer::$articles_start_char |
Definition at line 65 of file CategoryPage.php.
Referenced by columnList(), formatList(), and shortList().
CategoryViewer::$cat [private] |
Category object for this page.
Definition at line 71 of file CategoryPage.php.
Referenced by addSubcategoryObject(), and doCategoryQuery().
CategoryViewer::$children |
Definition at line 65 of file CategoryPage.php.
CategoryViewer::$children_start_char |
Definition at line 65 of file CategoryPage.php.
CategoryViewer::$from |
CategoryViewer::$gallery |
Definition at line 65 of file CategoryPage.php.
CategoryViewer::$limit |
CategoryViewer::$showGallery |
Definition at line 65 of file CategoryPage.php.
CategoryViewer::$skin |
Definition at line 65 of file CategoryPage.php.
CategoryViewer::$title |
Definition at line 65 of file CategoryPage.php.
Referenced by __construct(), addPage(), addSubcategory(), addSubcategoryObject(), doCategoryQuery(), getSubcategorySortChar(), and pagingLinks().
CategoryViewer::$until |