summaryrefslogtreecommitdiff
path: root/includes/specials/SpecialNewimages.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/specials/SpecialNewimages.php')
-rw-r--r--includes/specials/SpecialNewimages.php37
1 files changed, 27 insertions, 10 deletions
diff --git a/includes/specials/SpecialNewimages.php b/includes/specials/SpecialNewimages.php
index 37d29734..546c1914 100644
--- a/includes/specials/SpecialNewimages.php
+++ b/includes/specials/SpecialNewimages.php
@@ -20,6 +20,7 @@
* @file
* @ingroup SpecialPage
*/
+
class SpecialNewFiles extends IncludableSpecialPage {
public function __construct() {
parent::__construct( 'Newimages' );
@@ -32,6 +33,7 @@ class SpecialNewFiles extends IncludableSpecialPage {
$pager = new NewFilesPager( $this->getContext(), $par );
if ( !$this->including() ) {
+ $this->setTopText();
$form = $pager->getForm();
$form->prepareForm();
$form->displayForm( '' );
@@ -46,6 +48,25 @@ class SpecialNewFiles extends IncludableSpecialPage {
protected function getGroupName() {
return 'changes';
}
+
+ /**
+ * Send the text to be displayed above the options
+ */
+ function setTopText() {
+ global $wgContLang;
+
+ $message = $this->msg( 'newimagestext' )->inContentLanguage();
+ if ( !$message->isDisabled() ) {
+ $this->getOutput()->addWikiText(
+ Html::rawElement( 'p',
+ array( 'lang' => $wgContLang->getCode(), 'dir' => $wgContLang->getDir() ),
+ "\n" . $message->plain() . "\n"
+ ),
+ /* $lineStart */ false,
+ /* $interface */ false
+ );
+ }
+ }
}
/**
@@ -55,7 +76,7 @@ class NewFilesPager extends ReverseChronologicalPager {
/**
* @var ImageGallery
*/
- var $gallery;
+ protected $gallery;
function __construct( IContextSource $context, $par = null ) {
$this->like = $context->getRequest()->getText( 'like' );
@@ -68,7 +89,6 @@ class NewFilesPager extends ReverseChronologicalPager {
}
function getQueryInfo() {
- global $wgMiserMode;
$conds = $jconds = array();
$tables = array( 'image' );
@@ -88,7 +108,7 @@ class NewFilesPager extends ReverseChronologicalPager {
}
}
- if ( !$wgMiserMode && $this->like !== null ) {
+ if ( !$this->getConfig()->get( 'MiserMode' ) && $this->like !== null ) {
$dbr = wfGetDB( DB_SLAVE );
$likeObj = Title::newFromURL( $this->like );
if ( $likeObj instanceof Title ) {
@@ -120,12 +140,11 @@ class NewFilesPager extends ReverseChronologicalPager {
// Note that null for mode is taken to mean use default.
$mode = $this->getRequest()->getVal( 'gallerymode', null );
try {
- $this->gallery = ImageGalleryBase::factory( $mode );
+ $this->gallery = ImageGalleryBase::factory( $mode, $this->getContext() );
} catch ( MWException $e ) {
// User specified something invalid, fallback to default.
- $this->gallery = ImageGalleryBase::factory();
+ $this->gallery = ImageGalleryBase::factory( false, $this->getContext() );
}
- $this->gallery->setContext( $this->getContext() );
}
return '';
@@ -152,8 +171,6 @@ class NewFilesPager extends ReverseChronologicalPager {
}
function getForm() {
- global $wgMiserMode;
-
$fields = array(
'like' => array(
'type' => 'text',
@@ -162,7 +179,7 @@ class NewFilesPager extends ReverseChronologicalPager {
),
'showbots' => array(
'type' => 'check',
- 'label' => $this->msg( 'showhidebots', $this->msg( 'show' )->plain() )->escaped(),
+ 'label-message' => 'newimages-showbots',
'name' => 'showbots',
),
'limit' => array(
@@ -177,7 +194,7 @@ class NewFilesPager extends ReverseChronologicalPager {
),
);
- if ( $wgMiserMode ) {
+ if ( $this->getConfig()->get( 'MiserMode' ) ) {
unset( $fields['like'] );
}