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 64 of file CategoryPage.php.


Constructor & Destructor Documentation

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

Definition at line 73 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 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.

Deprecated:
kept for compatibility, please use addSubcategoryObject instead

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

Definition at line 113 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.

Parameters:
$articles Array
$articles_start_char Array
Returns:
String

Definition at line 363 of file CategoryPage.php.

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

Referenced by formatList().

CategoryViewer::doCategoryQuery (  ) 

CategoryViewer::finaliseCategoryState (  ) 

Definition at line 199 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 344 of file CategoryPage.php.

References $articles, $articles_start_char, columnList(), and shortList().

Referenced by getPagesSection(), and getSubcategorySection().

CategoryViewer::getCategoryBottom (  ) 

Definition at line 324 of file CategoryPage.php.

References pagingLinks().

Referenced by getHTML().

CategoryViewer::getCategoryTop (  ) 

Definition at line 257 of file CategoryPage.php.

References pagingLinks().

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 481 of file CategoryPage.php.

References $wgLang, and wfMsgExt().

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

CategoryViewer::getHTML (  ) 

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]

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

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.

Parameters:
$articles Array
$articles_start_char Array
Returns:
String

Definition at line 422 of file CategoryPage.php.

References $articles, and $articles_start_char.

Referenced by formatList().


Member Data Documentation

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

Definition at line 65 of file CategoryPage.php.

Referenced by __construct().

CategoryViewer::$gallery

Definition at line 65 of file CategoryPage.php.

CategoryViewer::$limit

Definition at line 65 of file CategoryPage.php.

Referenced by pagingLinks().

CategoryViewer::$showGallery

Definition at line 65 of file CategoryPage.php.

CategoryViewer::$skin

Definition at line 65 of file CategoryPage.php.

CategoryViewer::$title

CategoryViewer::$until

Definition at line 65 of file CategoryPage.php.

Referenced by __construct().


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

Generated on Sat Sep 5 02:08:34 2009 for MediaWiki by  doxygen 1.5.9