/** Name of the category, normalized to DB-key form */
private $mName = null;
private $mID = null;
- /** Category page title */
+ /**
+ * Category page title
+ * @var Title
+ */
private $mTitle = null;
/** Counts of membership (cat_pages, cat_subcats, cat_files) */
private $mPages = null, $mSubcats = null, $mFiles = null;
* Factory function.
*
* @param $title Title for the category page
- * @return Mixed: category, or false on a totally invalid name
+ * @return category|false on a totally invalid name
*/
public static function newFromTitle( $title ) {
$cat = new self();
* @param $row result set row, must contain the cat_xxx fields. If the fields are null,
* the resulting Category object will represent an empty category if a title object
* was given. If the fields are null and no title was given, this method fails and returns false.
- * @param $title optional title object for the category represented by the given row.
+ * @param Title $title optional title object for the category represented by the given row.
* May be provided if it is already known, to avoid having to re-create a title object later.
* @return Category
*/
public function getFileCount() { return $this->getX( 'mFiles' ); }
/**
- * @return mixed The Title for this category, or false on failure.
+ * @return Title|false Title for this category, or false on failure.
*/
public function getTitle() {
if ( $this->mTitle ) return $this->mTitle;
}
class CategoryViewer {
- var $title, $limit, $from, $until,
+ var $limit, $from, $until,
$articles, $articles_start_char,
$children, $children_start_char,
- $showGallery, $gallery,
- $imgsNoGalley, $imgsNoGallery_start_char,
- $skin, $collation;
- # Category object for this page
+ $showGallery, $imgsNoGalley,
+ $imgsNoGallery_start_char,
+ $skin, $imgsNoGallery;
+
+ /**
+ * @var
+ */
+ var $nextPage;
+
+ /**
+ * @var Array
+ */
+ var $flip;
+
+ /**
+ * @var Title
+ */
+ var $title;
+
+ /**
+ * @var Collation
+ */
+ var $collation;
+
+ /**
+ * @var ImageGallery
+ */
+ var $gallery;
+
+ /**
+ * Category object for this page
+ * @var Category
+ */
private $cat;
- # The original query array, to be used in generating paging links.
+
+ /**
+ * The original query array, to be used in generating paging links.
+ * @var array
+ */
private $query;
function __construct( $title, $from = '', $until = '', $query = array() ) {
}
}
+ /**
+ * @return Skin
+ */
function getSkin() {
if ( !$this->skin ) {
global $wgUser;
* 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...
+ *
+ * @param Title $title
+ * @param string $sortkey
*/
function getSubcategorySortChar( $title, $sortkey ) {
global $wgContLang;
static function shortList( $articles, $articles_start_char ) {
$r = '<h3>' . htmlspecialchars( $articles_start_char[0] ) . "</h3>\n";
$r .= '<ul><li>' . $articles[0] . '</li>';
- for ( $index = 1; $index < count( $articles ); $index++ )
- {
- if ( $articles_start_char[$index] != $articles_start_char[$index - 1] )
- {
+ for ( $index = 1; $index < count( $articles ); $index++ ) {
+ if ( $articles_start_char[$index] != $articles_start_char[$index - 1] ) {
$r .= "</ul><h3>" . htmlspecialchars( $articles_start_char[$index] ) . "</h3>\n<ul>";
}
}
if ( $dbcnt == $rescnt || ( ( $rescnt == $this->limit || $fromOrUntil )
- && $dbcnt > $rescnt ) )
- {
+ && $dbcnt > $rescnt ) ) {
# Case 1: seems sane.
$totalcnt = $dbcnt;
} elseif ( $rescnt < $this->limit && !$fromOrUntil ) {