<?php
-
-if ( !defined( 'MEDIAWIKI' ) )
- die( 1 );
+/**
+ * List and paging of category members.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ * @file
+ */
class CategoryViewer extends ContextSource {
var $limit, $from, $until,
$imgsNoGallery;
/**
- * @var
+ * @var Array
*/
var $nextPage;
$r = wfMsgExt( 'category-empty', array( 'parse' ) );
}
- $lang = $this->getLang();
+ $lang = $this->getLanguage();
$langAttribs = array( 'lang' => $lang->getCode(), 'dir' => $lang->getDir() );
# put a div around the headings which are in the user language
$r = Html::openElement( 'div', $langAttribs ) . $r . '</div>';
/**
* Add a subcategory to the internal lists, using a Category object
+ * @param $cat Category
+ * @param $sortkey
+ * @param $pageLength
*/
function addSubcategoryObject( Category $cat, $sortkey, $pageLength ) {
// Subcategory; strip the 'Category' namespace from the link text.
* @deprecated since 1.17 kept for compatibility, please use addSubcategoryObject instead
*/
function addSubcategory( Title $title, $sortkey, $pageLength ) {
+ wfDeprecated( __METHOD__, '1.17' );
$this->addSubcategoryObject( Category::newFromTitle( $title ), $sortkey, $pageLength );
}
*
* @param Title $title
* @param string $sortkey The human-readable sortkey (before transforming to icu or whatever).
- */
+ * @return string
+ */
function getSubcategorySortChar( $title, $sortkey ) {
global $wgContLang;
/**
* Add a page in the image namespace
+ * @param $title Title
+ * @param $sortkey
+ * @param $pageLength
+ * @param $isRedirect bool
*/
function addImage( Title $title, $sortkey, $pageLength, $isRedirect = false ) {
global $wgContLang;
/**
* Add a miscellaneous page
+ * @param $title
+ * @param $sortkey
+ * @param $pageLength
+ * @param $isRedirect bool
*/
function addPage( $title, $sortkey, $pageLength, $isRedirect = false ) {
global $wgContLang;
}
}
+ /**
+ * @return string
+ */
function getCategoryTop() {
$r = $this->getCategoryBottom();
return $r === ''
: "<br style=\"clear:both;\"/>\n" . $r;
}
+ /**
+ * @return string
+ */
function getSubcategorySection() {
# Don't show subcategories section if there are none.
$r = '';
return $r;
}
+ /**
+ * @return string
+ */
function getPagesSection() {
$ti = htmlspecialchars( $this->title->getText() );
# Don't show articles section if there are none.
return $r;
}
+ /**
+ * @return string
+ */
function getImageSection() {
$r = '';
$rescnt = $this->showGallery ? $this->gallery->count() : count( $this->imgsNoGallery );
}
}
+ /**
+ * @return string
+ */
function getCategoryBottom() {
return '';
}
# Split into three columns
$columns = array_chunk( $columns, ceil( count( $columns ) / 3 ), true /* preserve keys */ );
- $ret = '<table width="100%"><tr valign="top"><td>';
+ $ret = '<table width="100%"><tr valign="top">';
$prevchar = null;
foreach ( $columns as $column ) {
+ $ret .= '<td width="33.3%">';
$colContents = array();
# Kind of like array_flip() here, but we keep duplicates in an
$prevchar = $char;
}
- $ret .= "</td>\n<td>";
+ $ret .= "</td>\n";
}
- $ret .= '</td></tr></table>';
+ $ret .= '</tr></table>';
return $ret;
}
*
* @param Title $title: The title (usually $this->title)
* @param String $section: Which section
+ * @return Title
*/
private function addFragmentToTitle( $title, $section ) {
switch ( $section ) {