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:
parent
0406652eee
commit
a60b6f4048
2 changed files with 17 additions and 2 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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() );
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue