function formatRow($result) {
global $wgLang;
$title = Title::makeTitle( NS_CATEGORY, $result->cl_to );
- return (
- '<li>' .
- $this->getSkin()->makeLinkObj( $title, $title->getText() )
- . ' ' .
+ return Xml::tags('li', null,
+ $this->getSkin()->makeLinkObj( $title, $title->getText() ) . ' (' .
wfMsgExt( 'nmembers', array( 'parsemag', 'escape'),
- $wgLang->formatNum( $result->count ) )
- . "</li>\n" );
+ $wgLang->formatNum( $result->count ) ) . ')'
+ ) . "\n";
}
}
$mime = isset( $par ) ? $par : $wgRequest->getText( 'mime' );
$wgOut->addHTML(
- wfElement( 'form',
+ Xml::openElement( 'form',
array(
'id' => 'specialmimesearch',
'method' => 'get',
'action' => $wgTitle->escapeLocalUrl()
- ),
- null
+ )
) .
- wfOpenElement( 'label' ) .
- wfMsgHtml( 'mimetype' ) .
- wfElement( 'input', array(
- 'type' => 'text',
- 'size' => 20,
- 'name' => 'mime',
- 'value' => $mime
- ),
- ''
- ) .
- ' ' .
- wfElement( 'input', array(
- 'type' => 'submit',
- 'value' => wfMsg( 'ilsubmit' )
- ),
- ''
- ) .
- wfCloseElement( 'label' ) .
- wfCloseElement( 'form' )
+ Xml::inputLabel( wfMsg( 'mimetype' ), 'mime', 'mime', 20, $mime ) .
+ Xml::submitButton( wfMsg( 'ilsubmit' ) ) .
+ Xml::closeElement( 'form' )
);
list( $major, $minor ) = wfSpecialMIMEsearchParse( $mime );
function formatResult( $skin, $result ) {
global $wgLang;
$title = Title::makeTitleSafe( $result->namespace, $result->title );
+ if ( !$title instanceof Title ) { throw new MWException('Invalid title in database'); }
$count = wfMsgExt( 'ncategories', array( 'parsemag', 'escape' ), $wgLang->formatNum( $result->value ) );
$link = $skin->makeKnownLinkObj( $title, $title->getText() );
return wfSpecialList( $link, $count );