From 64a0d90eb3306f7d6056a6faf702af276d60631d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Niklas=20Laxstr=C3=B6m?= Date: Sat, 5 May 2007 20:18:13 +0000 Subject: [PATCH] * Prettify * Rather throw an extension than split unuseful fatal error --- includes/SpecialCategories.php | 10 ++++------ includes/SpecialMIMEsearch.php | 27 +++++---------------------- includes/SpecialMostcategories.php | 1 + 3 files changed, 10 insertions(+), 28 deletions(-) diff --git a/includes/SpecialCategories.php b/includes/SpecialCategories.php index 45e1ae6cc9..7191fe9d55 100644 --- a/includes/SpecialCategories.php +++ b/includes/SpecialCategories.php @@ -53,13 +53,11 @@ class CategoryPager extends AlphabeticPager { function formatRow($result) { global $wgLang; $title = Title::makeTitle( NS_CATEGORY, $result->cl_to ); - return ( - '
  • ' . - $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 ) ) - . "
  • \n" ); + $wgLang->formatNum( $result->count ) ) . ')' + ) . "\n"; } } diff --git a/includes/SpecialMIMEsearch.php b/includes/SpecialMIMEsearch.php index d50efc0261..5ecfb35fcb 100644 --- a/includes/SpecialMIMEsearch.php +++ b/includes/SpecialMIMEsearch.php @@ -87,33 +87,16 @@ function wfSpecialMIMEsearch( $par = null ) { $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 ); diff --git a/includes/SpecialMostcategories.php b/includes/SpecialMostcategories.php index df2b9adf24..9a06f41c51 100644 --- a/includes/SpecialMostcategories.php +++ b/includes/SpecialMostcategories.php @@ -38,6 +38,7 @@ class MostcategoriesPage extends QueryPage { 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 ); -- 2.20.1