Merge "MultimediaViewer usable on Special file related pages when enabled"

This commit is contained in:
jenkins-bot 2014-12-23 18:15:43 +00:00 committed by Gerrit Code Review
commit b343f85c05

View file

@ -71,7 +71,14 @@ class MultimediaViewerHooks {
* @return bool * @return bool
*/ */
public static function getModulesForArticle( &$out, &$skin ) { 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 ); return self::getModules( $out );
} }