public $limit;
/** @var array */
- protected $from;
+ public $from;
/** @var array */
- protected $until;
+ public $until;
/** @var string[] */
public $articles;
public $articles_start_char;
/** @var array */
- protected $children;
+ public $children;
/** @var array */
- protected $children_start_char;
+ public $children_start_char;
/** @var bool */
- protected $showGallery;
+ public $showGallery;
/** @var array */
- protected $imgsNoGallery_start_char;
+ public $imgsNoGallery_start_char;
/** @var array */
- protected $imgsNoGallery;
+ public $imgsNoGallery;
/** @var array */
- protected $nextPage;
+ public $nextPage;
/** @var array */
protected $prevPage;
/** @var array */
- protected $flip;
+ public $flip;
/** @var Title */
- protected $title;
+ public $title;
/** @var Collation */
- protected $collation;
+ public $collation;
/** @var ImageGallery */
- protected $gallery;
+ public $gallery;
/** @var Category Category object for this page. */
private $cat;
* @return string HTML output
*/
public function getHTML() {
- wfProfileIn( __METHOD__ );
$this->showGallery = $this->getConfig()->get( 'CategoryMagicGallery' )
&& !$this->getOutput()->mNoGallery;
}
$lang = $this->getLanguage();
- $langAttribs = array( 'lang' => $lang->getCode(), 'dir' => $lang->getDir() );
+ $langAttribs = array( 'lang' => $lang->getHtmlCode(), 'dir' => $lang->getDir() );
# put a div around the headings which are in the user language
$r = Html::openElement( 'div', $langAttribs ) . $r . '</div>';
- wfProfileOut( __METHOD__ );
return $r;
}
$mode = $this->getRequest()->getVal( 'gallerymode', null );
try {
$this->gallery = ImageGalleryBase::factory( $mode, $this->getContext() );
- } catch ( MWException $e ) {
+ } catch ( Exception $e ) {
// User specified something invalid, fallback to default.
$this->gallery = ImageGalleryBase::factory( false, $this->getContext() );
}
if ( $rescnt > 0 ) {
# Showing subcategories
- $r .= "<div id=\"mw-subcategories\">\n";
- $r .= '<h2>' . $this->msg( 'subcategories' )->text() . "</h2>\n";
+ $r .= Html::openElement( 'div', array( 'id' => 'mw-subcategories' ) );
+ $r .= "\n";
+ $r .= Html::element( 'h2', array(), $this->msg( 'subcategories' )->text() );
+ $r .= "\n";
$r .= $countmsg;
$r .= $this->getSectionPagingLinks( 'subcat' );
$r .= $this->formatList( $this->children, $this->children_start_char );
$r .= $this->getSectionPagingLinks( 'subcat' );
- $r .= "\n</div>";
+ $r .= "\n";
+ $r .= Html::closeElement( 'div' );
}
return $r;
}
$countmsg = $this->getCountMessage( $rescnt, $dbcnt, 'article' );
if ( $rescnt > 0 ) {
- $r = "<div id=\"mw-pages\">\n";
- $r .= '<h2>' . $this->msg( 'category_header', $ti )->text() . "</h2>\n";
+ $r .= Html::openElement( 'div', array( 'id' => 'mw-pages' ) );
+ $r .= "\n";
+ $r .= Html::element( 'h2', array(), $this->msg( 'category_header', $ti )->text() );
+ $r .= "\n";
$r .= $countmsg;
$r .= $this->getSectionPagingLinks( 'page' );
$r .= $this->formatList( $this->articles, $this->articles_start_char );
$r .= $this->getSectionPagingLinks( 'page' );
- $r .= "\n</div>";
+ $r .= "\n";
+ $r .= Html::closeElement( 'div' );
}
return $r;
}
}
$pageLang = $this->title->getPageLanguage();
- $attribs = array( 'lang' => $pageLang->getCode(), 'dir' => $pageLang->getDir(),
+ $attribs = array( 'lang' => $pageLang->getHtmlCode(), 'dir' => $pageLang->getDir(),
'class' => 'mw-content-' . $pageLang->getDir() );
$list = Html::rawElement( 'div', $attribs, $list );