<?php
-
-function wfSpecialImagelist()
-{
- global $wgUser, $wgOut, $wgLang, $wgRequest;
+/**
+ *
+ * @package MediaWiki
+ * @subpackage SpecialPage
+ */
+
+/**
+ *
+ */
+function wfSpecialImagelist() {
+ global $wgUser, $wgOut, $wgLang, $wgContLang, $wgRequest;
$sort = $wgRequest->getVal( 'sort' );
$wpIlMatch = $wgRequest->getText( 'wpIlMatch' );
$sql .= " ORDER BY img_name";
$st = $byname;
} else {
+ $sort = "bydate";
$sql .= " ORDER BY img_timestamp DESC";
$st = $bydate;
}
list( $limit, $offset ) = wfCheckLimits( 50 );
if ( 0 == $limit ) {
- $lt = wfMsg( "all" );
+ $lt = wfMsg( 'imagelistall' );
} else {
$lt = $wgLang->formatNum( "${limit}" );
$sql .= " LIMIT {$limit}";
htmlspecialchars( $wpIlMatch ) . "\" /> " .
"<input type='submit' name=\"wpIlSubmit\" value=\"{$sub}\" /></form>" );
$nums = array( 50, 100, 250, 500 );
- $here = $wgLang->specialPage( "Imagelist" );
+ $here = Title::makeTitle( NS_SPECIAL, 'Imagelist' );
$fill = "";
$first = true;
if ( ! $first ) { $fill .= " | "; }
$first = false;
- $fill .= $sk->makeKnownLink( $here, $wgLang->formatNum( $num ),
+ $fill .= $sk->makeKnownLinkObj( $here, $wgLang->formatNum( $num ),
"sort=byname&limit={$num}&wpIlMatch=" . urlencode( $wpIlMatch ) );
}
$text = wfMsg( "showlast", $fill, $byname );
if ( ! $first ) { $fill .= " | "; }
$first = false;
- $fill .= $sk->makeKnownLink( $here, $wgLang->formatNum( $num ),
+ $fill .= $sk->makeKnownLinkObj( $here, $wgLang->formatNum( $num ),
"sort=bysize&limit={$num}&wpIlMatch=" . urlencode( $wpIlMatch ) );
}
$text = wfMsg( "showlast", $fill, $bysize );
if ( ! $first ) { $fill .= " | "; }
$first = false;
- $fill .= $sk->makeKnownLink( $here, $wgLang->formatNum( $num ),
+ $fill .= $sk->makeKnownLinkObj( $here, $wgLang->formatNum( $num ),
"sort=bydate&limit={$num}&wpIlMatch=" . urlencode( $wpIlMatch ) );
}
$text = wfMsg( "showlast", $fill, $bydate );
while ( $s = $dbr->fetchObject( $res ) ) {
$name = $s->img_name;
$ut = $s->img_user_text;
- if ( 0 == $s->img_user ) { $ul = $ut; }
- else { $ul = $sk->makeLink( $wgLang->getNsText(
- Namespace::getUser() ) . ":{$ut}", $ut ); }
+ if ( 0 == $s->img_user ) {
+ $ul = $ut;
+ } else {
+ $ul = $sk->makeLinkObj( Title::makeTitle( NS_USER, $ut ), $ut );
+ }
- $ilink = "<a href=\"" . Image::wfImageUrl( $name ) .
- "\">{$name}</a>";
+ $ilink = "<a href=\"" . htmlspecialchars( Image::imageUrl( $name ) ) .
+ "\">" . htmlspecialchars( $name ) . "</a>";
$nb = wfMsg( "nbytes", $wgLang->formatNum( $s->img_size ) );
$l = "(" .
- $sk->makeKnownLink( $wgLang->getNsText(
- Namespace::getImage() ) . ":{$name}", wfMsg( "imgdesc" ) ) .
+ $sk->makeKnownLinkObj( Title::makeTitle( NS_IMAGE, $name ),
+ wfMsg( "imgdesc" ) ) .
") {$ilink} . . {$nb} . . {$ul} . . " .
$wgLang->timeanddate( $s->img_timestamp, true );
- if ( "" != $s->img_description ) {
- $l .= " <em>({$s->img_description})</em>";
- }
+ $l .= $sk->commentBlock( $s->img_description );
$wgOut->addHTML( "{$l}<br />\n" );
}
$wgOut->addHTML( "</p>" );