getSkinName() === 'vector' && ( // Article in the VisualEditor namespace $wgTitle->getNamespace() === NS_VISUALEDITOR || // Special page action for an article in the VisualEditor namespace $skin->getRelevantTitle()->getNamespace() === NS_VISUALEDITOR ) ) { $output->addModules( array( 'ext.visualEditor.viewPageTarget' ) ); } return true; } /** * Adds extra variables to the page config. * * This is attached to the MediaWiki 'MakeGlobalVariablesScript' hook. */ public static function onMakeGlobalVariablesScript( &$vars ) { global $wgUser, $wgTitle; $vars['wgVisualEditor'] = array( 'isPageWatched' => $wgUser->isWatched( $wgTitle ) ); return true; } }