*/
class SpecialListFiles extends IncludableSpecialPage {
-
public function __construct() {
parent::__construct( 'Listfiles' );
}
$search = $this->getRequest()->getText( 'ilsearch', '' );
}
- $pager = new ImageListPager( $this->getContext(), $userName, $search, $this->including() );
+ $pager = new ImageListPager(
+ $this->getContext(),
+ $userName,
+ $search,
+ $this->including()
+ );
if ( $this->including() ) {
$html = $pager->getBody();
var $mSearch = '';
var $mIncluding = false;
- function __construct( IContextSource $context, $userName = null, $search = '', $including = false ) {
+ function __construct( IContextSource $context, $userName = null, $search = '',
+ $including = false
+ ) {
global $wgMiserMode;
$this->mIncluding = $including;
if ( $search != '' && !$wgMiserMode ) {
$this->mSearch = $search;
$nt = Title::newFromURL( $this->mSearch );
+
if ( $nt ) {
$dbr = wfGetDB( DB_SLAVE );
$this->mQueryConds[] = 'LOWER(img_name)' .
$this->mFieldNames['count'] = $this->msg( 'listfiles_count' )->text();
}
}
+
return $this->mFieldNames;
}
# No index for both img_size and img_user_text
return !isset( $this->mQueryConds['img_user_text'] );
}
+
return in_array( $field, $sortable );
}
}
$join_conds = array( 'oldimage' => array( 'LEFT JOIN', 'oi_name = img_name' ) );
}
+
return array(
'tables' => $tables,
'fields' => $fields,
case 'thumb':
$file = wfLocalFile( $value );
$thumb = $file->transform( array( 'width' => 180, 'height' => 360 ) );
+
return $thumb->toHtml( array( 'desc-link' => true ) );
case 'img_timestamp':
- return htmlspecialchars( $this->getLanguage()->userTimeAndDate( $value, $this->getUser() ) );
+ $timeAndDate = $this->getLanguage()->userTimeAndDate( $value, $this->getUser() );
+ return htmlspecialchars( $timeAndDate );
case 'img_name':
static $imgfile = null;
if ( $imgfile === null ) {
// Weird files can maybe exist? Bug 22227
$filePage = Title::makeTitleSafe( NS_FILE, $value );
if ( $filePage ) {
- $link = Linker::linkKnown( $filePage, htmlspecialchars( $filePage->getText() ) );
+ $link = Linker::linkKnown(
+ $filePage,
+ htmlspecialchars( $filePage->getText() )
+ );
$download = Xml::element( 'a',
array( 'href' => wfLocalFile( $filePage )->getURL() ),
$imgfile
);
$download = $this->msg( 'parentheses' )->rawParams( $download )->escaped();
+
return "$link $download";
} else {
return htmlspecialchars( $value );
} else {
$link = htmlspecialchars( $value );
}
+
return $link;
case 'img_size':
return htmlspecialchars( $this->getLanguage()->formatSize( $value ) );
$inputForm = array();
$inputForm['table_pager_limit_label'] = $this->getLimitSelect();
if ( !$wgMiserMode ) {
- $inputForm['listfiles_search_for'] = Html::input( 'ilsearch', $this->mSearch, 'text',
+ $inputForm['listfiles_search_for'] = Html::input(
+ 'ilsearch',
+ $this->mSearch,
+ 'text',
array(
'size' => '40',
'maxlength' => '255',
'id' => 'mw-ilsearch',
- ) );
+ )
+ );
}
$inputForm['username'] = Html::input( 'user', $this->mUserName, 'text', array(
'size' => '40',
'maxlength' => '255',
'id' => 'mw-listfiles-user',
) );
+
return Html::openElement( 'form',
- array( 'method' => 'get', 'action' => $wgScript, 'id' => 'mw-listfiles-form' ) ) .
+ array( 'method' => 'get', 'action' => $wgScript, 'id' => 'mw-listfiles-form' )
+ ) .
Xml::fieldset( $this->msg( 'listfiles' )->text() ) .
Html::hidden( 'title', $this->getTitle()->getPrefixedText() ) .
Xml::buildForm( $inputForm, 'table_pager_limit_submit' ) .
$query['user'] = $this->mUserName;
}
}
+
return $queries;
}
if ( !isset( $queries['user'] ) && !is_null( $this->mUserName ) ) {
$queries['user'] = $this->mUserName;
}
+
return $queries;
}