CategoryViewer Class Reference

List of all members.

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.


Detailed Description

Definition at line 63 of file CategoryPage.php.


Constructor & Destructor Documentation

CategoryViewer::__construct ( title,
from = '',
until = '' 
)

Definition at line 72 of file CategoryPage.php.

References $from, $title, $until, $wgCategoryPagingLimit, and Category::newFromTitle().


Member Function Documentation

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.

Deprecated:
kept for compatibility, please use addSubcategoryObject instead

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 (  ) 

Definition at line 123 of file CategoryPage.php.

Referenced by getHTML().

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.

Parameters:
$articles Array
$articles_start_char Array
Returns:
String

Definition at line 386 of file CategoryPage.php.

References $articles, $articles_start_char, $columns, and wfMsgHtml().

Referenced by formatList().

CategoryViewer::doCategoryQuery (  ) 

CategoryViewer::finaliseCategoryState (  ) 

Definition at line 219 of file CategoryPage.php.

Referenced by getHTML().

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.

Parameters:
$articles Array
$articles_start_char Array
$cutoff Int
Returns:
String

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.

Parameters:
$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'
Returns:
String: A message giving the number of items, to output to HTML.

Definition at line 512 of file CategoryPage.php.

References $wgLang, and wfMsgExt().

Referenced by getImageSection(), getPagesSection(), and getSubcategorySection().

CategoryViewer::getHTML (  ) 

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]

Parameters:
$title Title object
$first String
$last String
$limit Int
$query Array: additional query options to pass
Returns:
String

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.

Parameters:
$articles Array
$articles_start_char Array
Returns:
String

Definition at line 438 of file CategoryPage.php.

References $articles, and $articles_start_char.

Referenced by formatList().


Member Data Documentation

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

Definition at line 64 of file CategoryPage.php.

Referenced by __construct().

CategoryViewer::$gallery

Definition at line 64 of file CategoryPage.php.

CategoryViewer::$limit

Definition at line 64 of file CategoryPage.php.

Referenced by pagingLinks().

CategoryViewer::$showGallery

Definition at line 64 of file CategoryPage.php.

CategoryViewer::$skin

Definition at line 64 of file CategoryPage.php.

CategoryViewer::$title

CategoryViewer::$until

Definition at line 64 of file CategoryPage.php.

Referenced by __construct().


The documentation for this class was generated from the following file:

Generated on Sat Apr 30 22:57:33 2011 for MediaWiki by  doxygen 1.5.9