Brian Wolff has uploaded a new change for review.
https://gerrit.wikimedia.org/r/80678
Change subject: Add url parameter to trigger autogenerated gallery type.
......................................................................
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
---
M includes/CategoryViewer.php
M includes/specials/SpecialNewimages.php
2 files changed, 17 insertions(+), 2 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/78/80678/1
diff --git a/includes/CategoryViewer.php b/includes/CategoryViewer.php
index a9f5d23..5b6694f 100644
--- a/includes/CategoryViewer.php
+++ b/includes/CategoryViewer.php
@@ -141,7 +141,15 @@
$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 {
diff --git a/includes/specials/SpecialNewimages.php
b/includes/specials/SpecialNewimages.php
index fa9b2d3..814e213 100644
--- a/includes/specials/SpecialNewimages.php
+++ b/includes/specials/SpecialNewimages.php
@@ -117,7 +117,14 @@
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() );
}
--
To view, visit https://gerrit.wikimedia.org/r/80678
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib12ac8228c824533262e1896adf2618dd298f655
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Brian Wolff <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits