mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/MultimediaViewer
synced 2024-11-24 00:03:56 +00:00
Merge "Streamline user options check for readability"
This commit is contained in:
commit
90d4a066b4
|
@ -81,17 +81,11 @@ class Hooks implements MakeGlobalVariablesScriptHook {
|
|||
global $wgMediaViewerEnableByDefaultForAnonymous,
|
||||
$wgMediaViewerEnableByDefault;
|
||||
|
||||
if ( $wgMediaViewerEnableByDefaultForAnonymous === null ) {
|
||||
$enableByDefaultForAnons = $wgMediaViewerEnableByDefault;
|
||||
} else {
|
||||
$enableByDefaultForAnons = $wgMediaViewerEnableByDefaultForAnonymous;
|
||||
}
|
||||
|
||||
if ( !$performer->isRegistered() ) {
|
||||
return (bool)$enableByDefaultForAnons;
|
||||
} else {
|
||||
if ( $performer->isRegistered() ) {
|
||||
return (bool)$this->userOptionsLookup->getOption( $performer, 'multimediaviewer-enable' );
|
||||
}
|
||||
|
||||
return (bool)( $wgMediaViewerEnableByDefaultForAnonymous ?? $wgMediaViewerEnableByDefault );
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue