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 ] ]; } } }