Go to the documentation of this file.
27 'https://mediawiki.org/wiki/Special:MyLanguage/Extension:Media_Viewer/About';
31 'https://mediawiki.org/wiki/Special:MyLanguage/Extension_talk:Media_Viewer/About';
35 'https://mediawiki.org/wiki/Special:MyLanguage/Help:Extension:Media_Viewer';
45 $defaultOptions[
'multimediaviewer-enable'] = 1;
65 return (
bool)$enableByDefaultForAnons;
67 return (
bool)$user->
getOption(
'multimediaviewer-enable' );
76 protected static function getModules( OutputPage $out ) {
77 $out->addModules( [
'mmv.head',
'mmv.bootstrap.autostart' ] );
88 $pageHasThumbnails = count( $out->getFileSearchOptions() ) > 0;
89 $pageIsFilePage = $out->getTitle()->inNamespace(
NS_FILE );
93 $out->getTitle()->getContentModel() ===
'flow-board';
94 $fileRelatedSpecialPages = [
'NewFiles',
'ListFiles',
'MostLinkedFiles',
95 'MostGloballyLinkedFiles',
'UncategorizedFiles',
'UnusedFiles',
'Search' ];
96 $pageIsFileRelatedSpecialPage = $out->getTitle()->inNamespace(
NS_SPECIAL )
97 && in_array( $out->getTitle()->getText(), $fileRelatedSpecialPages );
99 if ( $pageHasThumbnails || $pageIsFilePage || $pageIsFileRelatedSpecialPage || $pageIsFlowPage ) {
112 if ( $cat->getFileCount() > 0 ) {
125 $prefs[
'multimediaviewer-enable'] = [
127 'label-message' =>
'multimediaviewer-optin-pref',
128 'section' =>
'rendering/files',
147 $vars[
'wgMultimediaViewer'] = [
160 'tooltipDelay' => 1000,
161 'extensions' => $wgMediaViewerExtensions,
163 $vars[
'wgMediaViewer'] =
true;
175 $user = $out->getUser();
178 $vars[
'wgMediaViewerEnabledByDefault'] =
179 !empty( $defaultUserOptions[
'multimediaviewer-enable'] );
201 if ( method_exists(
$file,
'getWidth' ) ) {
202 $attribs[
'data-file-width'] =
$file->getWidth();
205 if ( method_exists(
$file,
'getHeight' ) ) {
206 $attribs[
'data-file-height'] =
$file->getHeight();
Media transform output for images.
if(PHP_SAPI !='cli-server') if(!isset( $_SERVER['SCRIPT_FILENAME'])) $file
Item class for a filearchive table row.
static getDefaultOptions()
Combine the language default options with any site-specific options and add the default language vari...
getTitle()
Get the title object of the article.
getContext()
Gets the context this Article is executed in.
static newFromTitle( $title)
Factory function.
getOption( $oname, $defaultOverride=null, $ignoreHidden=false)
Get the user's current setting for a given option.
isLoggedIn()
Get whether the user is logged in.
The User object encapsulates all of the user-specific settings (user_id, name, rights,...