summaryrefslogtreecommitdiff
path: root/includes/specials/SpecialMIMEsearch.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2013-01-18 16:46:04 +0100
committerPierre Schmitz <pierre@archlinux.de>2013-01-18 16:46:04 +0100
commit63601400e476c6cf43d985f3e7b9864681695ed4 (patch)
treef7846203a952e38aaf66989d0a4702779f549962 /includes/specials/SpecialMIMEsearch.php
parent8ff01378c9e0207f9169b81966a51def645b6a51 (diff)
Update to MediaWiki 1.20.2
this update includes: * adjusted Arch Linux skin * updated FluxBBAuthPlugin * patch for https://bugzilla.wikimedia.org/show_bug.cgi?id=44024
Diffstat (limited to 'includes/specials/SpecialMIMEsearch.php')
-rw-r--r--includes/specials/SpecialMIMEsearch.php31
1 files changed, 16 insertions, 15 deletions
diff --git a/includes/specials/SpecialMIMEsearch.php b/includes/specials/SpecialMIMEsearch.php
index 2213ffa4..104c653f 100644
--- a/includes/specials/SpecialMIMEsearch.php
+++ b/includes/specials/SpecialMIMEsearch.php
@@ -45,9 +45,9 @@ class MIMEsearchPage extends QueryPage {
public function getQueryInfo() {
return array(
'tables' => array( 'image' ),
- 'fields' => array( "'" . NS_FILE . "' AS namespace",
- 'img_name AS title',
- 'img_major_mime AS value',
+ 'fields' => array( 'namespace' => NS_FILE,
+ 'title' => 'img_name',
+ 'value' => 'img_major_mime',
'img_size',
'img_width',
'img_height',
@@ -59,17 +59,19 @@ class MIMEsearchPage extends QueryPage {
}
function execute( $par ) {
+ global $wgScript;
+
$mime = $par ? $par : $this->getRequest()->getText( 'mime' );
$this->setHeaders();
$this->outputHeader();
$this->getOutput()->addHTML(
- Xml::openElement( 'form', array( 'id' => 'specialmimesearch', 'method' => 'get', 'action' => SpecialPage::getTitleFor( 'MIMEsearch' )->getLocalUrl() ) ) .
+ Xml::openElement( 'form', array( 'id' => 'specialmimesearch', 'method' => 'get', 'action' => $wgScript ) ) .
Xml::openElement( 'fieldset' ) .
- Html::hidden( 'title', SpecialPage::getTitleFor( 'MIMEsearch' )->getPrefixedText() ) .
- Xml::element( 'legend', null, wfMsg( 'mimesearch' ) ) .
- Xml::inputLabel( wfMsg( 'mimetype' ), 'mime', 'mime', 20, $mime ) . ' ' .
- Xml::submitButton( wfMsg( 'ilsubmit' ) ) .
+ Html::hidden( 'title', $this->getTitle()->getPrefixedText() ) .
+ Xml::element( 'legend', null, $this->msg( 'mimesearch' )->text() ) .
+ Xml::inputLabel( $this->msg( 'mimetype' )->text(), 'mime', 'mime', 20, $mime ) . ' ' .
+ Xml::submitButton( $this->msg( 'ilsubmit' )->text() ) .
Xml::closeElement( 'fieldset' ) .
Xml::closeElement( 'form' )
);
@@ -93,17 +95,16 @@ class MIMEsearchPage extends QueryPage {
htmlspecialchars( $text )
);
- $download = Linker::makeMediaLinkObj( $nt, wfMsgHtml( 'download' ) );
+ $download = Linker::makeMediaLinkObj( $nt, $this->msg( 'download' )->escaped() );
+ $download = $this->msg( 'parentheses' )->rawParams( $download )->escaped();
$lang = $this->getLanguage();
$bytes = htmlspecialchars( $lang->formatSize( $result->img_size ) );
- $dimensions = htmlspecialchars( wfMsg( 'widthheight',
- $lang->formatNum( $result->img_width ),
- $lang->formatNum( $result->img_height )
- ) );
+ $dimensions = $this->msg( 'widthheight' )->numParams( $result->img_width,
+ $result->img_height )->escaped();
$user = Linker::link( Title::makeTitle( NS_USER, $result->img_user_text ), htmlspecialchars( $result->img_user_text ) );
- $time = htmlspecialchars( $lang->timeanddate( $result->img_timestamp ) );
+ $time = htmlspecialchars( $lang->userTimeAndDate( $result->img_timestamp, $this->getUser() ) );
- return "($download) $plink . . $dimensions . . $bytes . . $user . . $time";
+ return "$download $plink . . $dimensions . . $bytes . . $user . . $time";
}
/**