. * * @file * @ingroup extensions * @author Mark Holmquist * @copyright Copyright © 2013, Mark Holmquist */ class MultimediaViewerHooks { // Add JavaScript to the page when an image is on it // and the user has enabled the feature. static function getModules( &$out, &$skin ) { if ( BetaFeatures::isFeatureEnabled( $out->getUser(), 'multimedia-viewer' ) && count( $out->getFileSearchOptions() ) > 0 ) { $out->addModules( array( 'ext.multimediaViewer' ) ); } return true; } // Add a beta preference to gate the feature static function getBetaPreferences( $user, &$prefs ) { global $wgExtensionAssetsPath; $prefs['multimedia-viewer'] = array( 'label-message' => 'multimediaviewer-pref', 'desc-message' => 'multimediaviewer-pref-desc', 'info-link' => 'https://mediawiki.org/wiki/Multimedia/Media_Viewer', 'discussion-link' => 'https://mediawiki.org/wiki/Talk:Multimedia/Media_Viewer', // 'screenshot' => $wgExtensionAssetsPath . '/MultimediaViewer/images/screenshot.png', ); return true; } }