MediaWiki  1.34.0
MultimediaViewerHooks Class Reference

Static Public Member Functions

static onBeforePageDisplay (OutputPage $out, $skin)
 
static onCategoryPageView (CategoryPage $catPage)
 
static onGetPreferences ( $user, &$prefs)
 
static onMakeGlobalVariablesScript (array &$vars, OutputPage $out)
 
static onResourceLoaderGetConfigVars (array &$vars)
 
static onThumbnailBeforeProduceHTML (ThumbnailImage $thumbnail, array &$attribs, &$linkAttribs)
 
static onUserGetDefaultOptions (array &$defaultOptions)
 

Static Protected Member Functions

static getModules (OutputPage $out)
 Handler for all places where we add the modules Could be on article pages or on Category pages. More...
 
static shouldHandleClicks (User $user)
 Checks the context for whether to load the viewer. More...
 

Static Protected Attributes

static $discussionLink
 Link to a page where this module can be discussed. More...
 
static $helpLink
 Link to help about this module. More...
 
static $infoLink
 Link to more information about this module. More...
 

Detailed Description

Definition at line 24 of file MultimediaViewerHooks.php.

Member Function Documentation

◆ getModules()

static MultimediaViewerHooks::getModules ( OutputPage  $out)
staticprotected

Handler for all places where we add the modules Could be on article pages or on Category pages.

Parameters
OutputPage$out

Definition at line 76 of file MultimediaViewerHooks.php.

Referenced by onBeforePageDisplay(), and onCategoryPageView().

◆ onBeforePageDisplay()

static MultimediaViewerHooks::onBeforePageDisplay ( OutputPage  $out,
  $skin 
)
static
See also
https://www.mediawiki.org/wiki/Manual:Hooks/BeforePageDisplay Add JavaScript to the page when an image is on it and the user has enabled the feature
Parameters
OutputPage$out
Skin$skin

Definition at line 87 of file MultimediaViewerHooks.php.

References ExtensionRegistry\getInstance(), getModules(), NS_FILE, and NS_SPECIAL.

◆ onCategoryPageView()

static MultimediaViewerHooks::onCategoryPageView ( CategoryPage  $catPage)
static
See also
https://www.mediawiki.org/wiki/Manual:Hooks/CategoryPageView Add JavaScript to the page if there are images in the category
Parameters
CategoryPage$catPage

Definition at line 109 of file MultimediaViewerHooks.php.

References $title, Article\getContext(), getModules(), Article\getTitle(), and Category\newFromTitle().

◆ onGetPreferences()

static MultimediaViewerHooks::onGetPreferences (   $user,
$prefs 
)
static
See also
https://www.mediawiki.org/wiki/Manual:Hooks/GetPreferences Adds a default-enabled preference to gate the feature
Parameters
User$user
array&$prefs

Definition at line 124 of file MultimediaViewerHooks.php.

◆ onMakeGlobalVariablesScript()

static MultimediaViewerHooks::onMakeGlobalVariablesScript ( array &  $vars,
OutputPage  $out 
)
static
See also
https://www.mediawiki.org/wiki/Manual:Hooks/MakeGlobalVariablesScript Export variables which depend on the current user
Parameters
array&$vars
OutputPage$out

Definition at line 172 of file MultimediaViewerHooks.php.

References User\getDefaultOptions(), and shouldHandleClicks().

◆ onResourceLoaderGetConfigVars()

◆ onThumbnailBeforeProduceHTML()

static MultimediaViewerHooks::onThumbnailBeforeProduceHTML ( ThumbnailImage  $thumbnail,
array &  $attribs,
$linkAttribs 
)
static
See also
https://www.mediawiki.org/wiki/Manual:Hooks/ThumbnailBeforeProduceHTML Modify thumbnail DOM
Parameters
ThumbnailImage$thumbnail
array&$attribsAttributes of the element
array | bool&$linkAttribsAttributes of the wrapping element

Definition at line 189 of file MultimediaViewerHooks.php.

References $file, and MediaTransformOutput\getFile().

◆ onUserGetDefaultOptions()

static MultimediaViewerHooks::onUserGetDefaultOptions ( array &  $defaultOptions)
static
See also
https://www.mediawiki.org/wiki/Manual:Hooks/UserGetDefaultOptions
Parameters
array&$defaultOptions

Definition at line 41 of file MultimediaViewerHooks.php.

References $wgMediaViewerEnableByDefault.

◆ shouldHandleClicks()

static MultimediaViewerHooks::shouldHandleClicks ( User  $user)
staticprotected

Checks the context for whether to load the viewer.

Parameters
User$user
Returns
bool

Definition at line 54 of file MultimediaViewerHooks.php.

References $wgMediaViewerEnableByDefault, $wgMediaViewerEnableByDefaultForAnonymous, User\getOption(), and User\isLoggedIn().

Referenced by onMakeGlobalVariablesScript().

Member Data Documentation

◆ $discussionLink

MultimediaViewerHooks::$discussionLink
staticprotected
Initial value:
=
'https://mediawiki.org/wiki/Special:MyLanguage/Extension_talk:Media_Viewer/About'

Link to a page where this module can be discussed.

Definition at line 30 of file MultimediaViewerHooks.php.

Referenced by onResourceLoaderGetConfigVars().

◆ $helpLink

MultimediaViewerHooks::$helpLink
staticprotected
Initial value:
=
'https://mediawiki.org/wiki/Special:MyLanguage/Help:Extension:Media_Viewer'

Link to help about this module.

Definition at line 34 of file MultimediaViewerHooks.php.

Referenced by onResourceLoaderGetConfigVars().

◆ $infoLink

MultimediaViewerHooks::$infoLink
staticprotected
Initial value:
=
'https://mediawiki.org/wiki/Special:MyLanguage/Extension:Media_Viewer/About'

Link to more information about this module.

Definition at line 26 of file MultimediaViewerHooks.php.

Referenced by onResourceLoaderGetConfigVars().


The documentation for this class was generated from the following file: