Add url parameter to trigger autogenerated gallery type.

This was requested at commons as a temporary measure to
evaluate the new gallery options.

Change-Id: Ib12ac8228c824533262e1896adf2618dd298f655
This commit is contained in:
Brian Wolff 2013-08-23 15:13:40 -07:00
parent 0406652eee
commit a60b6f4048
2 changed files with 17 additions and 2 deletions

View file

@ -141,7 +141,15 @@ class CategoryViewer extends ContextSource {
$this->children = array();
$this->children_start_char = array();
if ( $this->showGallery ) {
$this->gallery = ImageGalleryBase::factory();
// Note that null for mode is taken to mean use default.
$mode = $this->getRequest()->getVal( 'gallerymode', null );
try {
$this->gallery = ImageGalleryBase::factory( $mode );
} catch ( MWException $e ) {
// User specified something invalid, fallback to default.
$this->gallery = ImageGalleryBase::factory();
}
$this->gallery->setHideBadImages();
$this->gallery->setContext( $this->getContext() );
} else {

View file

@ -117,7 +117,14 @@ class NewFilesPager extends ReverseChronologicalPager {
function getStartBody() {
if ( !$this->gallery ) {
$this->gallery = ImageGalleryBase::factory();
// Note that null for mode is taken to mean use default.
$mode = $this->getRequest()->getVal( 'gallerymode', null );
try {
$this->gallery = ImageGalleryBase::factory( $mode );
} catch ( MWException $e ) {
// User specified something invalid, fallback to default.
$this->gallery = ImageGalleryBase::factory();
}
$this->gallery->setContext( $this->getContext() );
}