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' );
77 $out->
addModules( [
'mmv.head',
'mmv.bootstrap.autostart' ] );
91 $pageIsFlowPage = ExtensionRegistry::getInstance()->isLoaded(
'Flow' ) &&
93 $out->
getTitle()->getContentModel() ===
'flow-board';
94 $fileRelatedSpecialPages = [
'NewFiles',
'ListFiles',
'MostLinkedFiles',
95 'MostGloballyLinkedFiles',
'UncategorizedFiles',
'UnusedFiles',
'Search' ];
97 && in_array( $out->
getTitle()->getText(), $fileRelatedSpecialPages );
99 if ( $pageHasThumbnails || $pageIsFilePage || $pageIsFileRelatedSpecialPage || $pageIsFlowPage ) {
111 $cat = Category::newFromTitle(
$title );
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;
173 $defaultUserOptions = User::getDefaultOptions();
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();
getContext()
Gets the context this Article is executed in.
getTitle()
Get the title object of the article.
This is one of the Core classes and should be read at least once by any new developers.
getFileSearchOptions()
Get the files used on this page.
addModules( $modules)
Load one or more ResourceLoader modules on this page.
Media transform output for images.
The User object encapsulates all of the user-specific settings (user_id, name, rights,...
getOption( $oname, $defaultOverride=null, $ignoreHidden=false)
Get the user's current setting for a given option.
isLoggedIn()
Get whether the user is logged in.
if(PHP_SAPI !='cli-server') if(!isset( $_SERVER['SCRIPT_FILENAME'])) $file
Item class for a filearchive table row.