/**
  * Handler for BeforePageDisplay hook
  * Add JavaScript to the page when an image is on it
  * and the user has enabled the feature if BetaFeatures is installed
  * @param OutputPage $out
  * @param Skin $skin
  * @return bool
  */
 public static function getModulesForArticle(&$out, &$skin)
 {
     if (count($out->getFileSearchOptions()) > 0 || $out->getTitle()->inNamespace(NS_FILE)) {
         return self::getModules($out);
     }
     return true;
 }
 /**
  * Handler for BeforePageDisplay hook
  * Add JavaScript to the page when an image is on it
  * and the user has enabled the feature if BetaFeatures is installed
  * @param OutputPage $out
  * @param Skin $skin
  * @return bool
  */
 public static function getModulesForArticle(&$out, &$skin)
 {
     $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 true;
 }