Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F4058912
BetaPreferenceHooks.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
BetaPreferenceHooks.php
View Options
<?php
namespace
MediaWiki\Extension\VisualEditor
;
use
MediaWiki\Config\Config
;
use
MediaWiki\Config\ConfigFactory
;
use
MediaWiki\Extension\BetaFeatures\Hooks\GetBetaFeaturePreferencesHook
;
use
MediaWiki\MainConfigNames
;
use
MediaWiki\User\User
;
/**
* Hooks from BetaFeatures extension,
* which is optional to use with this extension.
*/
class
BetaPreferenceHooks
implements
GetBetaFeaturePreferencesHook
{
private
Config
$coreConfig
;
private
Config
$config
;
public
function
__construct
(
Config
$coreConfig
,
ConfigFactory
$configFactory
)
{
$this
->
coreConfig
=
$coreConfig
;
$this
->
config
=
$configFactory
->
makeConfig
(
'visualeditor'
);
}
/**
* Handler for the GetBetaFeaturePreferences hook, to add and hide user beta preferences as configured
*
* @param User $user
* @param array &$preferences
*/
public
function
onGetBetaFeaturePreferences
(
User
$user
,
array
&
$preferences
)
{
if
(
$this
->
config
->
get
(
'VisualEditorEnableCollabBeta'
)
)
{
$iconpath
=
$this
->
coreConfig
->
get
(
MainConfigNames
::
ExtensionAssetsPath
)
.
'/VisualEditor/images'
;
$preferences
[
'visualeditor-collab'
]
=
[
'version'
=>
'1.0'
,
'label-message'
=>
'visualeditor-preference-collab-label'
,
'desc-message'
=>
'visualeditor-preference-collab-description'
,
'screenshot'
=>
[
'ltr'
=>
"$iconpath/betafeatures-icon-collab-ltr.svg"
,
'rtl'
=>
"$iconpath/betafeatures-icon-collab-rtl.svg"
,
],
'info-message'
=>
'visualeditor-preference-collab-info-link'
,
'discussion-message'
=>
'visualeditor-preference-collab-discussion-link'
,
'requirements'
=>
[
'javascript'
=>
true
]
];
}
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Aug 16 2026, 05:05 (12 w, 1 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
4e/3d/4921fb3f6d0e636a545e10dc5971
Default Alt Text
BetaPreferenceHooks.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment