mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/MultimediaViewer
synced 2024-11-11 17:00:23 +00:00
Support conditional user defaults
Thanks to T321527, MediaWiki makes it possible for default values of user properties to vary by user. Depends-On: I1549c3137e66801c85e03e46427e27da333d68e2 Bug: T354329 Change-Id: Ib6717be54d4f898b8b0433ee44b57f1e3e960545
This commit is contained in:
parent
d1c35338f0
commit
81ce7b08bd
|
@ -206,9 +206,12 @@ class Hooks implements
|
|||
* @return void
|
||||
*/
|
||||
public function onMakeGlobalVariablesScript( &$vars, $out ): void {
|
||||
$isMultimediaViewerEnable = $this->userOptionsLookup->getDefaultOption( 'multimediaviewer-enable' );
|
||||
|
||||
$user = $out->getUser();
|
||||
$isMultimediaViewerEnable = $this->userOptionsLookup->getDefaultOption(
|
||||
'multimediaviewer-enable',
|
||||
$user
|
||||
);
|
||||
|
||||
$vars['wgMediaViewerOnClick'] = $this->shouldHandleClicks( $user );
|
||||
// needed because of T71942; could be different for anon and logged-in
|
||||
$vars['wgMediaViewerEnabledByDefault'] = (bool)$isMultimediaViewerEnable;
|
||||
|
|
Loading…
Reference in a new issue