function __construct( IContextSource $context, $userName = null, $search = '',
$including = false, $showAll = false
) {
- global $wgMiserMode;
-
$this->mIncluding = $including;
$this->mShowAll = $showAll;
}
}
- if ( $search !== '' && !$wgMiserMode ) {
+ if ( $search !== '' && !$this->getConfig()->get( 'MiserMode' ) ) {
$this->mSearch = $search;
$nt = Title::newFromURL( $this->mSearch );
*/
function getFieldNames() {
if ( !$this->mFieldNames ) {
- global $wgMiserMode;
$this->mFieldNames = array(
'img_timestamp' => $this->msg( 'listfiles_date' )->text(),
'img_name' => $this->msg( 'listfiles_name' )->text(),
// img_description down here, in order so that its still after the username field.
$this->mFieldNames['img_description'] = $this->msg( 'listfiles_description' )->text();
- if ( !$wgMiserMode && !$this->mShowAll ) {
+ if ( !$this->getConfig()->get( 'MiserMode' ) && !$this->mShowAll ) {
$this->mFieldNames['count'] = $this->msg( 'listfiles_count' )->text();
}
if ( $this->mShowAll ) {
}
function isFieldSortable( $field ) {
- global $wgMiserMode;
if ( $this->mIncluding ) {
return false;
}
* In particular that means we cannot sort by timestamp when not filtering
* by user and including old images in the results. Which is sad.
*/
- if ( $wgMiserMode && !is_null( $this->mUserName ) ) {
+ if ( $this->getConfig()->get( 'MiserMode' ) && !is_null( $this->mUserName ) ) {
// If we're sorting by user, the index only supports sorting by time.
if ( $field === 'img_timestamp' ) {
return true;
} else {
return false;
}
- } elseif ( $wgMiserMode && $this->mShowAll /* && mUserName === null */ ) {
+ } elseif ( $this->getConfig()->get( 'MiserMode' ) && $this->mShowAll /* && mUserName === null */ ) {
// no oi_timestamp index, so only alphabetical sorting in this case.
if ( $field === 'img_name' ) {
return true;
}
function getDefaultSort() {
- global $wgMiserMode;
- if ( $this->mShowAll && $wgMiserMode && is_null( $this->mUserName ) ) {
+ if ( $this->mShowAll && $this->getConfig()->get( 'MiserMode' ) && is_null( $this->mUserName ) ) {
// Unfortunately no index on oi_timestamp.
return 'img_name';
} else {
}
function getForm() {
- global $wgScript, $wgMiserMode;
$inputForm = array();
$inputForm['table_pager_limit_label'] = $this->getLimitSelect( array( 'tabindex' => 1 ) );
- if ( !$wgMiserMode ) {
+ if ( !$this->getConfig()->get( 'MiserMode' ) ) {
$inputForm['listfiles_search_for'] = Html::input(
'ilsearch',
$this->mSearch,
) );
return Html::openElement( 'form',
- array( 'method' => 'get', 'action' => $wgScript, 'id' => 'mw-listfiles-form' )
+ array( 'method' => 'get', 'action' => wfScript(), 'id' => 'mw-listfiles-form' )
) .
Xml::fieldset( $this->msg( 'listfiles' )->text() ) .
Html::hidden( 'title', $this->getTitle()->getPrefixedText() ) .