/** * Adds extra variables to the page config. */ public static function onMakeGlobalVariablesScript(array &$vars, OutputPage $out) { global $wgMaxUploadSize, $wgEnableVisualEditorUI, $wgEnableWikiaInteractiveMaps, $wgIntMapConfig, $wgUser, $wgUploadPath, $wgReCaptchaPublicKey; $vars['wgMaxUploadSize'] = $wgMaxUploadSize; $vars['wgEnableVisualEditorUI'] = !empty($wgEnableVisualEditorUI); $vars['wgEnableWikiaInteractiveMaps'] = !empty($wgEnableWikiaInteractiveMaps); if (!empty($wgIntMapConfig)) { $vars['interactiveMapsApiURL'] = $wgIntMapConfig['protocol'] . '://' . $wgIntMapConfig['hostname'] . ':' . $wgIntMapConfig['port'] . '/api/' . $wgIntMapConfig['version']; } // Note: even if set as integer, option value is retrieved as string if ($wgUser->getGlobalPreference('showVisualEditorTransitionDialog') === '1') { $vars['showVisualEditorTransitionDialog'] = 1; } $vars['VignettePathPrefix'] = VignetteRequest::parsePathPrefix($wgUploadPath); $vars['reCaptchaPublicKey'] = $wgReCaptchaPublicKey; return true; }
public function getPathPrefix() { global $wgUploadPath; return VignetteRequest::parsePathPrefix($wgUploadPath); }
/** * @return string A language prefix */ public function getPathPrefix() { return VignetteRequest::parsePathPrefix($this->getUploadDir()); }
function getPathPrefix() { $wikiDbName = $this->repo->getDBName(); $wikiId = WikiFactory::DBtoID($wikiDbName); $wikiUploadPath = WikiFactory::getVarValueByName('wgUploadPath', $wikiId); return VignetteRequest::parsePathPrefix($wikiUploadPath); }