From 3244e8f1c65e68bbce9f54d9c8ee73be058e9db5 Mon Sep 17 00:00:00 2001 From: Namit Date: Tue, 23 Dec 2014 02:12:49 +0530 Subject: [PATCH] MultimediaViewer usable on Special file related pages when enabled When media viewer is enabled, go through the latest images in full-screen mode making it look neat. Bug: T63085 Bug: T73372 Change-Id: I8d92689eba580a88c98207e9197f1af0ea8ac96b --- MultimediaViewerHooks.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/MultimediaViewerHooks.php b/MultimediaViewerHooks.php index 2d6eecd10..dcd896001 100644 --- a/MultimediaViewerHooks.php +++ b/MultimediaViewerHooks.php @@ -71,7 +71,14 @@ class MultimediaViewerHooks { * @return bool */ public static function getModulesForArticle( &$out, &$skin ) { - if ( count( $out->getFileSearchOptions() ) > 0 || $out->getTitle()->inNamespace( NS_FILE ) ) { + $pageHasThumbnails = count( $out->getFileSearchOptions() ) > 0; + $pageIsFilePage = $out->getTitle()->inNamespace( NS_FILE ); + $fileRelatedSpecialPages = array( 'NewFiles', 'ListFiles', 'MostLinkedFiles', + 'MostGloballyLinkedFiles', 'UncategorizedFiles', 'UnusedFiles' ); + $pageIsFileRelatedSpecialPage = $out->getTitle()->inNamespace( NS_SPECIAL ) + && in_array( $out->getTitle()->getText(), $fileRelatedSpecialPages ); + + if ( $pageHasThumbnails || $pageIsFilePage || $pageIsFileRelatedSpecialPage ) { return self::getModules( $out ); }