. $nav );
}
+/**
+ * @addtogroup SpecialPage
+ * @addtogroup Pager
+ */
class ImageListPager extends TablePager {
var $mFieldNames = null;
var $mMessages = array();
function getFieldNames() {
if ( !$this->mFieldNames ) {
$this->mFieldNames = array(
- 'links' => '',
'img_timestamp' => wfMsg( 'imagelist_date' ),
'img_name' => wfMsg( 'imagelist_name' ),
'img_user_text' => wfMsg( 'imagelist_user' ),
function getQueryInfo() {
$fields = $this->getFieldNames();
- unset( $fields['links'] );
$fields = array_keys( $fields );
$fields[] = 'img_user';
return array(
function formatValue( $field, $value ) {
global $wgLang;
switch ( $field ) {
- case 'links':
- $name = $this->mCurrentRow->img_name;
- $ilink = "<a href=\"" . htmlspecialchars( Image::imageUrl( $name ) ) .
- "\">" . $this->mMessages['imgfile'] . "</a>";
- $desc = $this->getSkin()->makeKnownLinkObj( Title::makeTitle( NS_IMAGE, $name ),
- $this->mMessages['imgdesc'] );
- return "$desc | $ilink";
case 'img_timestamp':
return $wgLang->timeanddate( $value, true );
case 'img_name':
- return htmlspecialchars( $value );
+ $name = $this->mCurrentRow->img_name;
+ $link = $this->getSkin()->makeKnownLinkObj( Title::makeTitle( NS_IMAGE, $name ), $value );
+ $image = wfLocalFile( $value );
+ $url = $image->getURL();
+ $download = Xml::element('a', array( "href" => $url ), $this->mMessages['imgfile'] );
+ return "$link ($download)";
case 'img_user_text':
if ( $this->mCurrentRow->img_user ) {
$link = $this->getSkin()->makeLinkObj( Title::makeTitle( NS_USER, $value ),
}
return $link;
case 'img_size':
- return $wgLang->formatNum( $value );
+ return $this->getSkin()->formatSize( $value );
case 'img_description':
return $this->getSkin()->commentBlock( $value );
}
function getForm() {
global $wgRequest, $wgMiserMode;
- $url = $this->getTitle()->escapeLocalURL();
$search = $wgRequest->getText( 'ilsearch' );
- $s = "<form method=\"get\" action=\"$url\">\n" .
- wfMsgHtml( 'table_pager_limit', $this->getLimitSelect() );
+
+ $s = Xml::openElement( 'form', array( 'method' => 'get', 'action' => $this->getTitle()->getLocalURL(), 'id' => 'mw-imagelist-form' ) ) .
+ Xml::openElement( 'fieldset' ) .
+ Xml::element( 'legend', null, wfMsg( 'imagelist' ) ) .
+ wfMsgHtml( 'table_pager_limit', $this->getLimitSelect() );
+
if ( !$wgMiserMode ) {
$s .= "<br/>\n" .
- Xml::inputLabel( wfMsg( 'imagelist_search_for' ), 'ilsearch', 'mw-ilsearch', 20, $search );
+ Xml::inputLabel( wfMsg( 'imagelist_search_for' ), 'ilsearch', 'mw-ilsearch', 20, $search );
}
- $s .= " " . Xml::submitButton( wfMsg( 'table_pager_limit_submit' ) ) ." \n" .
+ $s .= ' ' .
+ Xml::submitButton( wfMsg( 'table_pager_limit_submit' ) ) ." \n" .
$this->getHiddenFields( array( 'limit', 'ilsearch' ) ) .
- "</form>\n";
+ Xml::closeElement( 'fieldset' ) .
+ Xml::closeElement( 'form' ) . "\n";
return $s;
}
}
}
-?>
+