MediaWiki
1.23.2
|
Public Member Functions | |
__construct ( $title, IContextSource $context, $from=array(), $until=array(), $query=array()) | |
Constructor. More... | |
addImage (Title $title, $sortkey, $pageLength, $isRedirect=false) | |
Add a page in the image namespace. More... | |
addPage ( $title, $sortkey, $pageLength, $isRedirect=false) | |
Add a miscellaneous page. More... | |
addSubcategoryObject (Category $cat, $sortkey, $pageLength) | |
Add a subcategory to the internal lists, using a Category object. More... | |
clearCategoryState () | |
doCategoryQuery () | |
finaliseCategoryState () | |
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. More... | |
getCategoryBottom () | |
getCategoryTop () | |
getHTML () | |
Format the category data list. More... | |
getImageSection () | |
getPagesSection () | |
getSubcategorySection () | |
getSubcategorySortChar ( $title, $sortkey) | |
Get the character to be used for sorting subcategories. More... | |
Public Member Functions inherited from ContextSource | |
canUseWikiPage () | |
Check whether a WikiPage object can be get with getWikiPage(). More... | |
exportSession () | |
Export the resolved user IP, HTTP headers, user ID, and session ID. More... | |
getConfig () | |
Get the Config object. More... | |
getContext () | |
Get the RequestContext object. More... | |
getLang () | |
Get the Language object. More... | |
getLanguage () | |
Get the Language object. More... | |
getOutput () | |
Get the OutputPage object. More... | |
getRequest () | |
Get the WebRequest object. More... | |
getSkin () | |
Get the Skin object. More... | |
getTitle () | |
Get the Title object. More... | |
getUser () | |
Get the User object. More... | |
getWikiPage () | |
Get the WikiPage object. More... | |
msg () | |
Get a Message object with context set Parameters are the same as wfMessage() More... | |
setContext (IContextSource $context) | |
Set the IContextSource object. More... | |
Static Public Member Functions | |
static | columnList ( $articles, $articles_start_char) |
Format a list of articles chunked by letter in a three-column list, ordered vertically. More... | |
Private Member Functions | |
addFragmentToTitle ( $title, $section) | |
Takes a title, and adds the fragment identifier that corresponds to the correct segment of the category. More... | |
getCountMessage ( $rescnt, $dbcnt, $type) | |
What to do if the category table conflicts with the number of results returned? This function says what. More... | |
getSectionPagingLinks ( $type) | |
Get the paging links for a section (subcats/pages/files), to go at the top and bottom of the output. More... | |
pagingLinks ( $first, $last, $type='') | |
Create paging links, as a helper method to getSectionPagingLinks(). More... | |
Static Private Member Functions | |
static | shortList ( $articles, $articles_start_char) |
Format a list of articles chunked by letter in a bullet list. More... | |
Private Attributes | |
Category | $cat |
Category object for this page. More... | |
array | $query |
The original query array, to be used in generating paging links. More... | |
Definition at line 23 of file CategoryViewer.php.
CategoryViewer::__construct | ( | $title, | |
IContextSource | $context, | ||
$from = array() , |
|||
$until = array() , |
|||
$query = array() |
|||
) |
Constructor.
$title | Title | |
$context | IContextSource | |
array | $from | An array with keys page, subcat, and file for offset of results of each section (since 1.17) |
array | $until | An array with 3 keys for until of each section (since 1.17) |
$query | Array |
Definition at line 72 of file CategoryViewer.php.
References $from, $query, $title, $until, from, global, Category\newFromTitle(), query, ContextSource\setContext(), Collation\singleton(), and title.
|
private |
Takes a title, and adds the fragment identifier that corresponds to the correct segment of the category.
Title | $title | The title (usually $this->title) |
string | $section | Which section |
MWException |
Definition at line 629 of file CategoryViewer.php.
References $section, $title, Title\getDBkey(), Title\getNamespace(), and Title\makeTitle().
Referenced by pagingLinks().
Add a page in the image namespace.
$title | Title |
$sortkey | |
$pageLength | |
$isRedirect | bool |
Definition at line 211 of file CategoryViewer.php.
References $flip, $link, $title, $wgContLang, global, and Linker\link().
Referenced by doCategoryQuery().
CategoryViewer::addPage | ( | $title, | |
$sortkey, | |||
$pageLength, | |||
$isRedirect = false |
|||
) |
Add a miscellaneous page.
$title | |
$sortkey | |
$pageLength | |
$isRedirect | bool |
Definition at line 241 of file CategoryViewer.php.
References $link, $title, $wgContLang, global, and Linker\link().
Referenced by doCategoryQuery().
CategoryViewer::addSubcategoryObject | ( | Category | $cat, |
$sortkey, | |||
$pageLength | |||
) |
Add a subcategory to the internal lists, using a Category object.
$cat | Category |
$sortkey | |
$pageLength |
Definition at line 162 of file CategoryViewer.php.
References $cat, $link, $title, getSubcategorySortChar(), Title\getText(), Category\getTitle(), Title\isRedirect(), and Linker\link().
Referenced by doCategoryQuery().
CategoryViewer::clearCategoryState | ( | ) |
Definition at line 133 of file CategoryViewer.php.
References $e, array(), ImageGalleryBase\factory(), ContextSource\getContext(), and ContextSource\getRequest().
Referenced by getHTML().
|
static |
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 508 of file CategoryViewer.php.
References $article, $articles, $articles_start_char, $columns, $ret, array(), as, and wfMessage().
Referenced by formatList().
CategoryViewer::doCategoryQuery | ( | ) |
Definition at line 271 of file CategoryViewer.php.
References $cat, $count, $dbr, $res, $title, $type, addImage(), addPage(), addSubcategoryObject(), array(), as, DB_SLAVE, from, Title\getCategorySortkey(), Title\getNamespace(), Category\newFromRow(), Title\newFromRow(), NS_CATEGORY, NS_FILE, title, and wfGetDB().
Referenced by getHTML().
CategoryViewer::finaliseCategoryState | ( | ) |
Definition at line 256 of file CategoryViewer.php.
Referenced by getHTML().
CategoryViewer::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.
$articles | Array |
$articles_start_char | Array |
$cutoff | Int |
Definition at line 476 of file CategoryViewer.php.
References $articles, $articles_start_char, $attribs, array(), columnList(), Html\rawElement(), shortList(), and title.
Referenced by getImageSection(), getPagesSection(), and getSubcategorySection().
CategoryViewer::getCategoryBottom | ( | ) |
Definition at line 462 of file CategoryViewer.php.
Referenced by getCategoryTop(), and getHTML().
CategoryViewer::getCategoryTop | ( | ) |
Definition at line 351 of file CategoryViewer.php.
References getCategoryBottom().
Referenced by getHTML().
|
private |
What to do if the category table conflicts with the number of results returned? This function says what.
Each type is considered independently of the other types.
int | $rescnt | The number of items returned by our database query. |
int | $dbcnt | The number of items according to the category table. |
string | $type | 'subcat', 'article', or 'file' |
Definition at line 659 of file CategoryViewer.php.
References $type, from, and ContextSource\msg().
Referenced by getImageSection(), getPagesSection(), and getSubcategorySection().
CategoryViewer::getHTML | ( | ) |
Format the category data list.
Definition at line 92 of file CategoryViewer.php.
References array(), clearCategoryState(), doCategoryQuery(), finaliseCategoryState(), getCategoryBottom(), getCategoryTop(), getImageSection(), ContextSource\getLanguage(), ContextSource\getOutput(), getPagesSection(), getSubcategorySection(), global, ContextSource\msg(), Html\openElement(), wfProfileIn(), and wfProfileOut().
CategoryViewer::getImageSection | ( | ) |
Definition at line 413 of file CategoryViewer.php.
References formatList(), getCountMessage(), getSectionPagingLinks(), ContextSource\msg(), title, and wfEscapeWikiText().
Referenced by getHTML().
CategoryViewer::getPagesSection | ( | ) |
Definition at line 384 of file CategoryViewer.php.
References formatList(), getCountMessage(), getSectionPagingLinks(), ContextSource\msg(), title, and wfEscapeWikiText().
Referenced by getHTML().
|
private |
Get the paging links for a section (subcats/pages/files), to go at the top and bottom of the output.
string | $type | 'page', 'subcat', or 'file' |
Definition at line 447 of file CategoryViewer.php.
References $type, from, and pagingLinks().
Referenced by getImageSection(), getPagesSection(), and getSubcategorySection().
CategoryViewer::getSubcategorySection | ( | ) |
Definition at line 361 of file CategoryViewer.php.
References formatList(), getCountMessage(), getSectionPagingLinks(), and ContextSource\msg().
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...
Title | $title | |
string | $sortkey | The human-readable sortkey (before transforming to icu or whatever). |
Definition at line 190 of file CategoryViewer.php.
References $title, $wgContLang, Title\getDBkey(), Title\getPrefixedText(), and global.
Referenced by addSubcategoryObject().
|
private |
Create paging links, as a helper method to getSectionPagingLinks().
string | $first | The 'until' parameter for the generated URL |
string | $last | The 'from' parameter for the generated URL |
string | $type | A prefix for parameters, 'page' or 'subcat' or 'file' |
Definition at line 588 of file CategoryViewer.php.
References $last, $query, $type, addFragmentToTitle(), array(), Linker\linkKnown(), ContextSource\msg(), and title.
Referenced by getSectionPagingLinks().
|
staticprivate |
Format a list of articles chunked by letter in a bullet list.
$articles | Array |
$articles_start_char | Array |
Definition at line 564 of file CategoryViewer.php.
References $articles, and $articles_start_char.
Referenced by formatList().
CategoryViewer::$articles |
Definition at line 24 of file CategoryViewer.php.
Referenced by columnList(), formatList(), and shortList().
CategoryViewer::$articles_start_char |
Definition at line 24 of file CategoryViewer.php.
Referenced by columnList(), formatList(), and shortList().
|
private |
Category object for this page.
Definition at line 54 of file CategoryViewer.php.
Referenced by addSubcategoryObject(), and doCategoryQuery().
CategoryViewer::$children |
Definition at line 24 of file CategoryViewer.php.
CategoryViewer::$children_start_char |
Definition at line 24 of file CategoryViewer.php.
Collation CategoryViewer::$collation |
Definition at line 45 of file CategoryViewer.php.
Array CategoryViewer::$flip |
Definition at line 37 of file CategoryViewer.php.
Referenced by addImage().
CategoryViewer::$from |
Definition at line 24 of file CategoryViewer.php.
Referenced by __construct().
ImageGallery CategoryViewer::$gallery |
Definition at line 49 of file CategoryViewer.php.
CategoryViewer::$imgsNoGallery |
Definition at line 24 of file CategoryViewer.php.
CategoryViewer::$imgsNoGallery_start_char |
Definition at line 24 of file CategoryViewer.php.
CategoryViewer::$imgsNoGalley |
Definition at line 24 of file CategoryViewer.php.
CategoryViewer::$limit |
Definition at line 24 of file CategoryViewer.php.
Array CategoryViewer::$nextPage |
Definition at line 33 of file CategoryViewer.php.
|
private |
The original query array, to be used in generating paging links.
Definition at line 59 of file CategoryViewer.php.
Referenced by __construct(), and pagingLinks().
CategoryViewer::$showGallery |
Definition at line 24 of file CategoryViewer.php.
Title CategoryViewer::$title |
Definition at line 41 of file CategoryViewer.php.
Referenced by __construct(), addFragmentToTitle(), addImage(), addPage(), addSubcategoryObject(), doCategoryQuery(), and getSubcategorySortChar().
CategoryViewer::$until |
Definition at line 24 of file CategoryViewer.php.
Referenced by __construct().