MediaWiki REL1_37
|
Public Member Functions | |
__construct (PageIdentity $page, IContextSource $context, array $from=[], array $until=[], array $query=[]) | |
addImage (PageReference $page, string $sortkey, int $pageLength, bool $isRedirect=false) | |
Add a page in the image namespace. | |
addPage (PageReference $page, string $sortkey, int $pageLength, bool $isRedirect=false) | |
Add a miscellaneous page. | |
addSubcategoryObject (Category $cat, $sortkey, $pageLength) | |
Add a subcategory to the internal lists, using a Category object. | |
getHTML () | |
Format the category data list. | |
getSubcategorySortChar (PageIdentity $page, string $sortkey) | |
Get the character to be used for sorting subcategories. | |
![]() | |
canUseWikiPage () | |
Check whether a WikiPage object can be get with getWikiPage(). | |
exportSession () | |
Export the resolved user IP, HTTP headers, user ID, and session ID. | |
getAuthority () | |
getConfig () | |
getContext () | |
Get the base IContextSource object. | |
getCsrfTokenSet () | |
Get a repository to obtain and match CSRF tokens. | |
getLanguage () | |
getOutput () | |
getRequest () | |
getSkin () | |
getStats () | |
getTiming () | |
getTitle () | |
getUser () | |
getWikiPage () | |
Get the WikiPage object. | |
msg ( $key,... $params) | |
Get a Message object with context set Parameters are the same as wfMessage() | |
setContext (IContextSource $context) | |
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. | |
static | shortList ( $articles, $articles_start_char) |
Format a list of articles chunked by letter in a bullet list. | |
Public Attributes | |
string[] | $articles |
array | $articles_start_char |
array | $children |
array | $children_start_char |
Collation | $collation |
array | $flip |
array | $from |
ImageGalleryBase | $gallery |
array | $imgsNoGallery |
array | $imgsNoGallery_start_char |
int | $limit |
array | $nextPage |
bool | $showGallery |
array | $until |
Protected Member Functions | |
clearCategoryState () | |
doCategoryQuery () | |
finaliseCategoryState () | |
getCategoryBottom () | |
getCategoryTop () | |
getImageSection () | |
getPagesSection () | |
getSubcategorySection () | |
Protected Attributes | |
PageIdentity | $page |
array | $prevPage |
Private Member Functions | |
addFragmentToTitle (PageReference $page, string $section) | |
Takes a title, and adds the fragment identifier that corresponds to the correct segment of the category. | |
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. | |
generateLink (string $type, PageReference $page, bool $isRedirect, ?string $html=null) | |
getCountMessage ( $rescnt, $dbcnt, $type) | |
What to do if the category table conflicts with the number of results returned? This function says what. | |
getSectionPagingLinks ( $type) | |
Get the paging links for a section (subcats/pages/files), to go at the top and bottom of the output. | |
pagingLinks ( $first, $last, $type='') | |
Create paging links, as a helper method to getSectionPagingLinks(). | |
Private Attributes | |
Category | $cat |
Category object for this page. | |
ILanguageConverter | $languageConverter |
array | $query |
The original query array, to be used in generating paging links. | |
Definition at line 29 of file CategoryViewer.php.
CategoryViewer::__construct | ( | PageIdentity | $page, |
IContextSource | $context, | ||
array | $from = [] , |
||
array | $until = [] , |
||
array | $query = [] |
||
) |
PageIdentity | $page | |
IContextSource | $context | |
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) |
array | $query |
Definition at line 99 of file CategoryViewer.php.
References ContextSource\$context, $from, $page, $query, $until, deprecatePublicPropertyFallback(), IContextSource\getConfig(), ContextSource\getOutput(), and ContextSource\setContext().
|
private |
Takes a title, and adds the fragment identifier that corresponds to the correct segment of the category.
PageReference | $page | The title (usually $this->title) |
string | $section | Which section |
MWException |
Definition at line 732 of file CategoryViewer.php.
CategoryViewer::addImage | ( | PageReference | $page, |
string | $sortkey, | ||
int | $pageLength, | ||
bool | $isRedirect = false |
||
) |
Add a page in the image namespace.
PageReference | $page | |
string | $sortkey | |
int | $pageLength | |
bool | $isRedirect |
Definition at line 289 of file CategoryViewer.php.
References $title.
CategoryViewer::addPage | ( | PageReference | $page, |
string | $sortkey, | ||
int | $pageLength, | ||
bool | $isRedirect = false |
||
) |
Add a miscellaneous page.
PageReference | $page | |
string | $sortkey | |
int | $pageLength | |
bool | $isRedirect |
Definition at line 316 of file CategoryViewer.php.
CategoryViewer::addSubcategoryObject | ( | Category | $cat, |
$sortkey, | |||
$pageLength | |||
) |
Add a subcategory to the internal lists, using a Category object.
Category | $cat | |
string | $sortkey | |
int | $pageLength |
Definition at line 205 of file CategoryViewer.php.
References $cat, generateLink(), Category\getPage(), and getSubcategorySortChar().
|
protected |
Definition at line 177 of file CategoryViewer.php.
References ContextSource\getContext(), and ContextSource\getRequest().
Referenced by getHTML().
|
static |
Format a list of articles chunked by letter in a three-column list, ordered vertically.
This is used for categories with a significant number of pages.
TODO: Take the headers into account when creating columns, so they're more visually equal.
TODO: shortList and columnList are similar, need merging
string[] | $articles | HTML links to each article |
string[] | $articles_start_char | The header characters for each article |
Definition at line 618 of file CategoryViewer.php.
|
protected |
Definition at line 340 of file CategoryViewer.php.
References $dbr, $res, $title, $type, DB_REPLICA, NS_CATEGORY, NS_FILE, and wfGetDB().
Referenced by getHTML().
|
protected |
Definition at line 325 of file CategoryViewer.php.
Referenced by getHTML().
|
private |
Format a list of articles chunked by letter, either as a bullet list or a columnar format, depending on the length.
array | $articles | |
array | $articles_start_char | |
int | $cutoff |
Definition at line 585 of file CategoryViewer.php.
|
private |
string | $type | |
PageReference | $page | |
bool | $isRedirect | |
string | null | $html |
-taint | $html | tainted |
Definition at line 232 of file CategoryViewer.php.
References $page.
Referenced by addSubcategoryObject().
|
protected |
|
protected |
|
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 762 of file CategoryViewer.php.
References $type.
CategoryViewer::getHTML | ( | ) |
Format the category data list.
Definition at line 135 of file CategoryViewer.php.
References $lang, clearCategoryState(), doCategoryQuery(), finaliseCategoryState(), getCategoryBottom(), getCategoryTop(), ContextSource\getConfig(), getImageSection(), ContextSource\getLanguage(), ContextSource\getOutput(), getPagesSection(), getSubcategorySection(), and ContextSource\msg().
|
protected |
|
protected |
|
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 548 of file CategoryViewer.php.
References $type.
|
protected |
CategoryViewer::getSubcategorySortChar | ( | PageIdentity | $page, |
string | $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...
PageIdentity | $page | |
string | $sortkey | The human-readable sortkey (before transforming to icu or whatever). |
Definition at line 268 of file CategoryViewer.php.
References MediaWiki\Page\PageReference\getDBkey().
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 690 of file CategoryViewer.php.
References $type.
|
static |
Format a list of articles chunked by letter in a bullet list.
This is used for categories with a small number of pages (when columns aren't needed).
string[] | $articles | HTML links to each article |
string[] | $articles_start_char | The header characters for each article |
Definition at line 666 of file CategoryViewer.php.
string [] CategoryViewer::$articles |
Definition at line 43 of file CategoryViewer.php.
array CategoryViewer::$articles_start_char |
Definition at line 46 of file CategoryViewer.php.
|
private |
Category object for this page.
Definition at line 82 of file CategoryViewer.php.
Referenced by addSubcategoryObject().
array CategoryViewer::$children |
Definition at line 49 of file CategoryViewer.php.
array CategoryViewer::$children_start_char |
Definition at line 52 of file CategoryViewer.php.
Collation CategoryViewer::$collation |
Definition at line 76 of file CategoryViewer.php.
array CategoryViewer::$flip |
Definition at line 70 of file CategoryViewer.php.
array CategoryViewer::$from |
Definition at line 37 of file CategoryViewer.php.
Referenced by __construct().
ImageGalleryBase CategoryViewer::$gallery |
Definition at line 79 of file CategoryViewer.php.
array CategoryViewer::$imgsNoGallery |
Definition at line 61 of file CategoryViewer.php.
array CategoryViewer::$imgsNoGallery_start_char |
Definition at line 58 of file CategoryViewer.php.
|
private |
Definition at line 88 of file CategoryViewer.php.
int CategoryViewer::$limit |
Definition at line 34 of file CategoryViewer.php.
array CategoryViewer::$nextPage |
Definition at line 64 of file CategoryViewer.php.
|
protected |
Definition at line 73 of file CategoryViewer.php.
Referenced by __construct(), and generateLink().
|
protected |
Definition at line 67 of file CategoryViewer.php.
|
private |
The original query array, to be used in generating paging links.
Definition at line 85 of file CategoryViewer.php.
Referenced by __construct().
bool CategoryViewer::$showGallery |
Definition at line 55 of file CategoryViewer.php.
array CategoryViewer::$until |
Definition at line 40 of file CategoryViewer.php.
Referenced by __construct().