/** * Displays the reCAPTCHA widget. */ public function getForm() { $siteKey = $this->wg->ReCaptchaPublicKey; $theme = \SassUtil::isThemeDark() ? 'dark' : 'light'; $form = '<div class="g-recaptcha" data-sitekey="' . $siteKey . '" data-theme="' . $theme . '"></div>'; return $form; }
public function executeIndex($params) { wfProfileIn(__METHOD__); // add CSS for this module $this->wg->Out->addStyle(AssetsManager::getInstance()->getSassCommonURL("skins/oasis/css/modules/InsightsModule.scss")); $this->themeClass = SassUtil::isThemeDark() ? 'insights-dark' : 'insights-light'; $this->messageKeys = InsightsHelper::getMessageKeys(); wfProfileOut(__METHOD__); }
/** * The main, initializing function * @throws MWException */ public function index() { wfProfileIn(__METHOD__); $this->wg->Out->setPageTitle(wfMessage('insights')->escaped()); $this->addAssets(); /** * @var A slug of a subpage */ $this->subpage = $this->getPar(); $this->themeClass = SassUtil::isThemeDark() ? 'insights-dark' : 'insights-light'; /** * Check if a user requested a subpage. If the requested subpage * is unknown redirect them to the landing page. */ if (InsightsHelper::isInsightPage($this->subpage)) { $this->renderSubpage(); } elseif (!empty($this->subpage)) { $this->response->redirect($this->getSpecialInsightsUrl()); } wfProfileOut(__METHOD__); }
/** * Change the module used as an entry-point for Oasis skin and use custom class for rendering edit page * * Keep global and user nav only. * * @author macbre */ function setupEditPage(Article $editedArticle, $fullScreen = true, $class = false) { global $wgHooks; wfProfileIn(__METHOD__); $user = $this->app->wg->User; // don't render edit area when we're in read only mode if (wfReadOnly()) { // set correct page title $this->out->setPageTitle(wfMessage('editing', $this->app->getGlobal('wgTitle')->getPrefixedText())->escaped()); wfProfileOut(__METHOD__); return false; } // use "reskined" edit page layout $this->fullScreen = $fullScreen; if ($fullScreen) { // set Oasis entry-point Wikia::setVar('OasisEntryControllerName', 'EditPageLayout'); } // Disable custom JS while loading the edit page on MediaWiki JS pages and user subpages (BugID: 41449) $editedArticleTitle = $editedArticle->getTitle(); $editedArticleTitleNS = $editedArticleTitle->getNamespace(); $editedArticleTitleText = $editedArticleTitle->getText(); if ($editedArticleTitleNS === NS_MEDIAWIKI && substr($editedArticleTitleText, -3) === '.js' || $editedArticleTitleNS === NS_USER && preg_match('/^' . preg_quote($user->getName(), '/') . '\\/.*\\.js$/', $editedArticleTitleText)) { $this->out->disallowUserJs(); } // Add variables for pages to edit code (css, js, lua) if ($this->isCodeSyntaxHighlightingEnabled($editedArticleTitle)) { $this->prepareVarsForCodePage($editedArticleTitle); } // initialize custom edit page $this->editPage = new EditPageLayout($editedArticle); $editedTitle = $this->editPage->getEditedTitle(); $formCustomHandler = $this->editPage->getCustomFormHandler(); $this->addJsVariable('wgIsEditPage', true); $this->addJsVariable('wgEditedTitle', $editedTitle->getPrefixedText()); $this->addJsVariable('wgEditPageClass', $class ? $class : 'SpecialCustomEditPage'); $this->addJsVariable('wgEditPageHandler', !is_null($formCustomHandler) ? $formCustomHandler->getLocalUrl('wpTitle=$1') : $this->app->getGlobal('wgScript') . '?action=ajax&rs=EditPageLayoutAjax&title=$1'); $this->addJsVariable('wgEditPagePopularTemplates', TemplateService::getPromotedTemplates()); $this->addJsVariable('wgEditPageIsWidePage', $this->isWidePage()); $this->addJsVariable('wgIsDarkTheme', SassUtil::isThemeDark()); if ($user->isLoggedIn()) { global $wgRTEDisablePreferencesChange; $wgRTEDisablePreferencesChange = true; $this->addJsVariable('wgEditPageWideSourceMode', (bool) $user->getGlobalPreference('editwidth')); unset($wgRTEDisablePreferencesChange); } $this->addJsVariableRef('wgEditPageFormType', $this->editPage->formtype); $this->addJsVariableRef('wgEditPageIsConflict', $this->editPage->isConflict); $this->addJsVariable('wgEditPageIsReadOnly', $this->editPage->isReadOnlyPage()); $this->addJsVariableRef('wgEditPageHasEditPermissionError', $this->editPage->mHasPermissionError); $this->addJsVariableRef('wgEditPageSection', $this->editPage->section); // data for license module (BugId:6967) $titleLicensing = GlobalTitle::newFromText('Community_Central:Licensing', null, 177); $this->addJsVariable('wgEditPageLicensingUrl', $titleLicensing->getFullUrl()); $this->addJsVariable('wgRightsText', $this->app->wg->RightsText); // copyright warning for notifications (BugId:7951) $this->addJsVariable('wgCopywarn', $this->editPage->getCopyrightNotice()); // extra hooks for edit page $wgHooks['MakeGlobalVariablesScript'][] = 'EditPageLayoutHooks::onMakeGlobalVariablesScript'; $wgHooks['SkinGetPageClasses'][] = 'EditPageLayoutHooks::onSkinGetPageClasses'; $this->helper = self::getInstance(); wfProfileOut(__METHOD__); return $this->editPage; }
/** * Initialise a GeSHi object to format some code, performing * common setup for all our uses of it * * @param string $text * @param string $lang * @return GeSHi */ public static function prepare($text, $lang) { global $wgTitle, $wgOut; self::initialise(); $geshi = new GeSHi($text, $lang); if ($geshi->error() == GESHI_ERROR_NO_SUCH_LANG) { return null; } $geshi->set_encoding('UTF-8'); $geshi->enable_classes(); $geshi->set_overall_class("source-{$lang}"); $geshi->enable_keyword_links(false); // Wikia change start if ($wgTitle instanceof Title && EditPageLayoutHelper::isCodeSyntaxHighlightingEnabled($wgTitle)) { $theme = 'solarized-light'; if (SassUtil::isThemeDark()) { $theme = 'solarized-dark'; } $geshi->set_language_path(GESHI_ROOT . $theme . DIRECTORY_SEPARATOR); $geshi->set_overall_id('theme-' . $theme); $wgOut->addStyle(AssetsManager::getInstance()->getSassCommonURL('extensions/SyntaxHighlight_GeSHi/styles/solarized.scss')); } // Wikia change end return $geshi; }
/** * Displays the reCAPTCHA widget. */ function getForm() { $siteKey = F::app()->wg->ReCaptchaPublicKey; $theme = SassUtil::isThemeDark() ? 'dark' : 'light'; return '<div class="g-recaptcha" data-sitekey="' . $siteKey . '" data-theme="' . $theme . '"></div>'; }
/** * Return color scheme name to be used based on SASS color calculation * * @return string color scheme to be used ("light" or "dark") */ protected function getColorScheme() { return SassUtil::isThemeDark() ? 'dark' : 'light'; }
private function setBodyClasses() { // generate list of CSS classes for <body> tag $bodyClasses = ['mediawiki', $this->skinNameClass, $this->dir, $this->pageClass]; // add skin theme name if (!empty($this->skin->themename)) { $bodyClasses[] = 'venus-' . $this->skin->themename; } // mark dark themes if (SassUtil::isThemeDark()) { $bodyClasses[] = 'venus-dark-theme'; } $this->bodyClasses = implode(' ', array_merge($bodyClasses, self::getBackgroundClasses(), self::$bodyClassArray)); }
public function executeIndex($params) { global $wgOut, $wgUser, $wgTitle, $wgRequest, $wgCityId, $wgEnableAdminDashboardExt, $wgAllInOne, $wgOasisThemeSettings; wfProfileIn(__METHOD__); //Add Smart banner for My Wikia App //See: https://wikia-inc.atlassian.net/browse/MOB-167 $wgOut->addHeadItem('My Wikia Smart Banner', '<meta name="apple-itunes-app" content="app-id=623705389">'); /* set the grid if passed in, otherwise, respect the default */ $grid = $wgRequest->getVal('wikiagrid', ''); if ('1' === $grid) { $this->wg->OasisGrid = true; } else { if ('0' === $grid) { $this->wg->OasisGrid = false; } } /* end grid or full width */ $jsPackages = array(); $scssPackages = array(); $this->app->runHook('WikiaAssetsPackages', array(&$wgOut, &$jsPackages, &$scssPackages)); $this->isUserLoggedIn = $wgUser->isLoggedIn(); // TODO: move to CreateNewWiki extension - this code should use a hook $wikiWelcome = $wgRequest->getVal('wiki-welcome'); if (!empty($wikiWelcome)) { $wgOut->addStyle($this->assetsManager->getSassCommonURL('extensions/wikia/CreateNewWiki/css/WikiWelcome.scss')); $wgOut->addScript('<script src="' . $this->wg->ExtensionsPath . '/wikia/CreateNewWiki/js/WikiWelcome.js"></script>'); } if (RenderContentOnlyHelper::isRenderContentOnlyEnabled()) { $this->body = F::app()->renderView('BodyContentOnly', 'Index'); } else { // macbre: let extensions modify content of the page (e.g. EditPageLayout) wfProfileIn(__METHOD__ . ' - renderBody'); $this->body = !empty($params['body']) ? $params['body'] : F::app()->renderView('Body', 'Index'); wfProfileOut(__METHOD__ . ' - renderBody'); } // get microdata for body tag $this->itemType = self::getItemType(); $skin = RequestContext::getMain()->getSkin(); /* @var $skin WikiaSkin */ // this is bad but some extensions could have added some scripts to bottom queue // todo: make it not run twice during each request $this->bottomScripts = $skin->bottomScripts(); // generate list of CSS classes for <body> tag $bodyClasses = array('mediawiki', $this->dir, $this->pageClass); $bodyClasses = array_merge($bodyClasses, self::$extraBodyClasses); $bodyClasses[] = $this->skinNameClass; if (Wikia::isMainPage()) { $bodyClasses[] = 'mainpage'; } wfProfileIn(__METHOD__ . ' - skin Operations'); // add skin theme name if (!empty($skin->themename)) { $bodyClasses[] = "oasis-{$skin->themename}"; } // mark dark themes if (SassUtil::isThemeDark()) { $bodyClasses[] = 'oasis-dark-theme'; } /** * Login status based CSS class */ $bodyClasses[] = $skin->getUserLoginStatusClass(); // sets background settings by adding classes to <body> $bodyClasses = array_merge($bodyClasses, $this->getOasisBackgroundClasses($wgOasisThemeSettings)); $this->bodyClasses = $bodyClasses; if (is_array($scssPackages)) { foreach ($scssPackages as $package) { $wgOut->addStyle($this->assetsManager->getSassCommonURL('extensions/' . $package)); } } // Reset (this ensures no duplication in CSS links) $sassFiles = ['skins/oasis/css/oasis.scss']; $this->cssLinks = $skin->getStylesWithCombinedSASS($sassFiles); // $sassFiles will be updated by getStylesWithCombinedSASS method will all extracted and concatenated SASS files $this->bottomScripts .= Html::inlineScript("var wgSassLoadedScss = " . json_encode($sassFiles) . ";"); $this->headLinks = $wgOut->getHeadLinks(); $this->headItems = $skin->getHeadItems(); $this->pageTitle = htmlspecialchars($this->pageTitle); $this->displayTitle = htmlspecialchars($this->displayTitle); $this->mimeType = htmlspecialchars($this->mimeType); $this->charset = htmlspecialchars($this->charset); wfProfileOut(__METHOD__ . ' - skin Operations'); $this->topScripts = $wgOut->topScripts; if (is_array($jsPackages)) { foreach ($jsPackages as $package) { $wgOut->addScriptFile($this->wg->ExtensionsPath . '/' . $package); } } // setup loading of JS/CSS $this->loadJs(); // macbre: RT #25697 - hide Comscore & QuantServe tags on edit pages if (!in_array($wgRequest->getVal('action'), array('edit', 'submit'))) { $this->comScore = AnalyticsEngine::track('Comscore', AnalyticsEngine::EVENT_PAGEVIEW); $this->quantServe = AnalyticsEngine::track('QuantServe', AnalyticsEngine::EVENT_PAGEVIEW); $this->amazonMatch = AnalyticsEngine::track('AmazonMatch', AnalyticsEngine::EVENT_PAGEVIEW); $this->rubiconRtp = AnalyticsEngine::track('RubiconRTP', AnalyticsEngine::EVENT_PAGEVIEW); $this->dynamicYield = AnalyticsEngine::track('DynamicYield', AnalyticsEngine::EVENT_PAGEVIEW); $this->ivw2 = AnalyticsEngine::track('IVW2', AnalyticsEngine::EVENT_PAGEVIEW); } if (!empty($wgEnableAdminDashboardExt) && AdminDashboardLogic::displayAdminDashboard($this->app, $wgTitle)) { $this->displayAdminDashboard = true; } else { $this->displayAdminDashboard = false; } wfProfileOut(__METHOD__); }
/** * Set wiki theme setting to the ad units * @param array $adUnits * @param string $memcKey * @param boolean $setMemc - set to true to set data to memcache * @return array */ public function setThemeSettings($adUnits, $memcKey, $setMemc = true) { wfProfileIn(__METHOD__); $adTitle = $this->wf->Message('monetization-module-ad-title')->escaped(); $adUnits = str_replace(self::KEYWORD_AD_TITLE, $adTitle, $adUnits); $ecommTitle = $this->wf->Message('monetization-module-ecommerce-title')->escaped(); $adUnits = str_replace(self::KEYWORD_ECOMMERCE_TITLE, $ecommTitle, $adUnits); $theme = SassUtil::getOasisSettings(); if (SassUtil::isThemeDark()) { $theme['color'] = self::FONT_COLOR_DARK_THEME; } else { $theme['color'] = self::FONT_COLOR_LIGHT_THEME; } $adSettings = ''; foreach (self::$mapThemeSettings as $key => $value) { if (!empty($theme[$value])) { $adSettings .= $key . '="' . $theme[$value] . '" '; } } $adUnits = str_replace(self::KEYWORD_THEME_SETTINGS, $adSettings, $adUnits); // set data to cache if ($setMemc) { $this->setMemcache($memcKey, $adUnits, ['method' => __METHOD__]); } wfProfileOut(__METHOD__); return $adUnits; }
public function executeIndex($data) { wfProfileIn(__METHOD__); global $wgTitle, $wgLang, $wgContentNamespaces, $wgExtraNamespacesLocal; if(empty($wgExtraNamespacesLocal)){ $wgExtraNamespacesLocal = array(); } // set the page for which we're showing comments / likes // used for proper linking on blog posts listings if (!empty($data['title'])) { $this->contextTitle = $data['title']; } else { // by default we're showing # of comments for current page $this->contextTitle = &$wgTitle; } // Facebook's "Like" // @see http://developers.facebook.com/docs/reference/plugins/like if (!empty($data['likes'])) { $this->showLike = true; // canonical URL $this->likeHref = $this->contextTitle->getFullUrl(); // check namespaces $ns = $this->contextTitle->getNamespace(); if (in_array($ns, $wgContentNamespaces)) { $this->likeRef = 'content_page'; } // RT #74393: include custom namespaces else if (in_array($ns, array_keys($wgExtraNamespacesLocal))) { $this->likeRef = 'content_page'; } else if (defined('NS_BLOG_ARTICLE') && $ns == NS_BLOG_ARTICLE) { $this->likeRef = 'blog_page'; } else if ($ns == NS_CATEGORY) { $this->likeRef = 'category_page'; } else if (defined('NS_TOPLIST') && $ns == NS_TOPLIST) { $this->likeRef = 'list_page'; } else { $this->showLike = false; } // check lightness of skin theme $this->likeTheme = SassUtil::isThemeDark() ? 'dark' : 'light'; } // comments / talks if (isset($data['comments']) && is_numeric($data['comments'])) { $this->comments = $data['comments']; // format number of comments (1200 -> 1k, 9999 -> 9k, 1.300.000 -> 1M) $this->formattedComments = $this->comments; if ($this->comments > 999999) { $this->formattedComments = wfMsg('oasis-page-header-comments-m', floor($this->comments / 1000000)); } else if ($this->comments > 999) { $this->formattedComments = wfMsg('oasis-page-header-comments-k', floor($this->comments / 1000)); } $this->commentsLink = $this->getCommentsLink(); $this->commentsTooltip = $this->getCommentsTooltip(); $this->isArticleComments = $this->checkArticleComments(); // get source of comments number (comments / talk page revisions) $this->commentsEnabled = $this->checkArticleComments(); // pass accesskey => false to this module to disable accesskey attribute (BugId:15685) if (!isset($data['accesskey']) || $data['accesskey'] !== false) { $this->commentsAccesskey = ' accesskey="t"'; } // render comments count as just a bubble $this->commentsBubble = !empty($data['bubble']); } if ( $this->wg->OasisNavV2 ) { $this->response->getView()->setTemplatePath( dirname( __FILE__ ) .'/templates/CommentsLikes_IndexV2.php' ); } wfProfileOut(__METHOD__); }
/** * @dataProvider isThemeDarkProvider */ public function testIsThemeDark($color, $isDark) { $settings = ['color-page' => $color]; $this->assertEquals($isDark, SassUtil::isThemeDark($settings)); }
/** * Handle AJAX request and return bigger version of requested image */ public static function ajax() { global $wgTitle, $wgBlankImgUrl, $wgRequest, $wgServer, $wgStylePath, $wgExtensionsPath, $wgSitename; wfProfileIn(__METHOD__); // limit dimensions of returned image to fit browser's viewport $maxWidth = $wgRequest->getInt('maxwidth', 500) - 20; $maxHeight = $wgRequest->getInt('maxheight', 300) - 150; $showShareTools = $wgRequest->getInt('share', 0); $pageName = $wgRequest->getVal('pageName'); $image = wfFindFile($wgTitle); if (empty($image)) { wfProfileOut(__METHOD__); return array(); } if (F::build('WikiaFileHelper')->isFileTypeVideo($image)) { if (!empty($wgTitle)) { return self::videoLightbox($image); } } // get original dimensions of an image $width = $image->getWidth(); $height = $image->getHeight(); // don't try to make image larger if ($width > $maxWidth or $height > $maxHeight) { $width = $maxWidth; $height = $maxHeight; } // generate thumbnail $thumb = $image->transform(array('width' => $width, 'height' => $height)); $thumbHeight = $thumb->getHeight(); $thumbWidth = $thumb->getWidth(); // lightbox should not be smaller then 200x200 $wrapperHeight = max($thumbHeight, self::MIN_HEIGHT); $wrapperWidth = max($thumbWidth, self::MIN_WIDTH); //generate share links $currentTitle = Title::newFromText($pageName); if (empty($currentTitle)) { //should not happen, ever throw new MWException("Could not create Title from {$pageName}\n"); } $thumbUrl = $thumb->getUrl(); $imageTitle = $wgTitle->getText(); $imageParam = preg_replace('/[^a-z0-9_]/i', '-', Sanitizer::escapeId($imageTitle)); $linkStd = $currentTitle->getFullURL("image={$imageParam}"); $linkMail = $currentTitle->getFullURL("image={$imageParam}&open=email"); $linkWWW = "<a href=\"{$linkStd}\"><img width=\"" . $thumb->getWidth() . "\" height=\"" . $thumb->getHeight() . "\" src=\"{$thumbUrl}\"/></a>"; $linkBBcode = "[url={$linkStd}][img]{$thumbUrl}[/img][/url]"; $linkStdEncoded = rawurlencode($linkStd); $linkDescription = wfMsg('lightbox-share-description', $currentTitle->getText(), $wgSitename); $shareButtons = array(); $shareNetworks = F::build('SocialSharingService')->getNetworks(array('facebook', 'twitter', 'stumbleupon', 'reddit')); foreach ($shareNetworks as $n) { $type = $n->getId(); $shareButtons[] = array('class' => 'share-' . $type, 'text' => ucfirst($type), 'type' => $type, 'url' => $n->getUrl($linkStdEncoded, $linkDescription)); } // FB like - generate URL and check lightness of skin theme $likeHref = $linkStd; $likeTheme = SassUtil::isThemeDark() ? 'dark' : 'light'; // render HTML $tmpl = new EasyTemplate(dirname(__FILE__)); $tmpl->set_vars(array('href' => $wgTitle->getLocalUrl(), 'likeHref' => $likeHref, 'likeTheme' => $likeTheme, 'linkBBcode' => $linkBBcode, 'linkStd' => $linkStd, 'linkWWW' => $linkWWW, 'name' => $imageTitle, 'shareButtons' => $shareButtons, 'showShareTools' => $showShareTools, 'stylePath' => $wgStylePath, 'thumbHeight' => $thumbHeight, 'thumbUrl' => $thumbUrl, 'thumbWidth' => $thumbWidth, 'wgBlankImgUrl' => $wgBlankImgUrl, 'wgExtensionsPath' => $wgExtensionsPath, 'wrapperHeight' => $wrapperHeight, 'wrapperWidth' => $wrapperWidth, 'linkMail' => $linkMail)); $html = $tmpl->render('ImageLightbox'); $res = array('html' => $html, 'title' => $wgTitle->getText(), 'width' => $wrapperWidth); wfProfileOut(__METHOD__); return $res; }
public function executeIndex($params) { global $wgOut, $wgUser, $wgTitle, $wgRequest, $wgCityId, $wgEnableAdminDashboardExt, $wgAllInOne; wfProfileIn(__METHOD__); /* set the grid or full width if passed in, otherwise, respect the default */ $grid = $wgRequest->getVal('wikiagrid', ''); $fullhead = $wgRequest->getVal('wikiafullheader', ''); if ( '1' === $grid ) { $this->wg->OasisGrid = true; } else if ( '0' === $grid ) { $this->wg->OasisGrid = false; } if ( '1' === $fullhead ) { $this->wg->GlobalHeaderFullWidth = true; } else if ( '0' === $fullhead ) { $this->wg->GlobalHeaderFullWidth = false; } /* end grid or full width */ $jsPackages = array(); $scssPackages = array(); $this->app->runHook( 'WikiaAssetsPackages', array( &$wgOut, &$jsPackages, &$scssPackages ) ); $this->isUserLoggedIn = $wgUser->isLoggedIn(); // TODO: move to CreateNewWiki extension - this code should use a hook $wikiWelcome = $wgRequest->getVal('wiki-welcome'); if(!empty($wikiWelcome)) { $wgOut->addStyle( $this->assetsManager->getSassCommonURL( 'extensions/wikia/CreateNewWiki/css/WikiWelcome.scss' ) ); $wgOut->addScript( '<script src="' . $this->wg->ExtensionsPath . '/wikia/CreateNewWiki/js/WikiWelcome.js"></script>' ); } $renderContentOnly = false; if (!empty($this->wg->EnableRenderContentOnlyExt)) { if(renderContentOnly::isRenderContentOnlyEnabled()) { $renderContentOnly = true; } } if($renderContentOnly) { $this->body = F::app()->renderView('BodyContentOnly', 'Index'); } else { // macbre: let extensions modify content of the page (e.g. EditPageLayout) wfProfileIn(__METHOD__ . ' - renderBody'); $this->body = !empty($params['body']) ? $params['body'] : F::app()->renderView('Body', 'Index'); wfProfileOut(__METHOD__ . ' - renderBody'); } // get microdata for body tag $this->itemType = self::getItemType(); $skin = RequestContext::getMain()->getSkin(); /* @var $skin WikiaSkin */ // this is bad but some extensions could have added some scripts to bottom queue // todo: make it not run twice during each request $this->bottomScripts = $skin->bottomScripts(); // generate list of CSS classes for <body> tag $bodyClasses = array('mediawiki', $this->dir, $this->pageClass); $bodyClasses = array_merge($bodyClasses, self::$extraBodyClasses); $bodyClasses[] = $this->skinNameClass; if(Wikia::isMainPage()) { $bodyClasses[] = 'mainpage'; } wfProfileIn(__METHOD__ . ' - skin Operations'); // add skin theme name if(!empty($skin->themename)) { $bodyClasses[] = "oasis-{$skin->themename}"; } // mark dark themes if (SassUtil::isThemeDark()) { $bodyClasses[] = 'oasis-dark-theme'; } // support for oasis split skin if (!empty($this->wg->GlobalHeaderFullWidth)) { $bodyClasses[] = 'oasis-split-skin'; } $this->bodyClasses = $bodyClasses; if (is_array($scssPackages)) { foreach ($scssPackages as $package) { $wgOut->addStyle($this->assetsManager->getSassCommonURL('extensions/'.$package)); } } // Reset (this ensures no duplication in CSS links) $this->cssLinks = ''; $this->cssPrintLinks = ''; foreach ( $skin->getStyles() as $s ) { if ( !empty($s['url']) ) { $tag = $s['tag']; if ( !empty( $wgAllInOne ) ) { $url = $this->minifySingleAsset($s['url']); if ($url !== $s['url']) { $tag = str_replace($s['url'],$url,$tag); } } // Print styles will be loaded separately at the bottom of the page if ( stripos($tag, 'media="print"') !== false ) { $this->cssPrintLinks .= $tag; } else { $this->cssLinks .= $tag; } } else { $this->cssLinks .= $s['tag']; } } $this->headLinks = $wgOut->getHeadLinks(); $this->headItems = $skin->getHeadItems(); $this->pageTitle = htmlspecialchars( $this->pageTitle ); $this->displayTitle = htmlspecialchars( $this->displayTitle ); $this->mimeType = htmlspecialchars( $this->mimeType ); $this->charset = htmlspecialchars( $this->charset ); wfProfileOut(__METHOD__ . ' - skin Operations'); $this->topScripts = $wgOut->topScripts; if (is_array($jsPackages)) { foreach ($jsPackages as $package) { $wgOut->addScriptFile($this->wg->ExtensionsPath . '/' . $package); } } // setup loading of JS/CSS using WSL (WikiaScriptLoader) $this->loadJs(); // FIXME: create separate module for stats stuff? // load Google Analytics code $this->googleAnalytics = AnalyticsEngine::track('GA_Urchin', AnalyticsEngine::EVENT_PAGEVIEW); // onewiki GA $this->googleAnalytics .= AnalyticsEngine::track('GA_Urchin', 'onewiki', array($wgCityId)); // track page load time $this->googleAnalytics .= AnalyticsEngine::track('GA_Urchin', 'pagetime', array('oasis')); // track browser height TODO NEF no browser height tracking code anymore, remove //$this->googleAnalytics .= AnalyticsEngine::track('GA_Urchin', 'browser-height'); // record which varnish this page was served by $this->googleAnalytics .= AnalyticsEngine::track('GA_Urchin', 'varnish-stat'); // TODO NEF not used, remove //$this->googleAnalytics .= AnalyticsEngine::track('GA_Urchin', 'noads'); // TODO NEF we dont do AB this way anymore, remove //$this->googleAnalytics .= AnalyticsEngine::track('GA_Urchin', 'abtest'); // Add important Gracenote analytics for reporting needed for licensing on LyricWiki. if (43339 == $wgCityId){ $this->googleAnalytics .= AnalyticsEngine::track('GA_Urchin', 'lyrics'); } // macbre: RT #25697 - hide Comscore & QuantServe tags on edit pages if(!in_array($wgRequest->getVal('action'), array('edit', 'submit'))) { $this->comScore = AnalyticsEngine::track('Comscore', AnalyticsEngine::EVENT_PAGEVIEW); $this->quantServe = AnalyticsEngine::track('QuantServe', AnalyticsEngine::EVENT_PAGEVIEW); $this->ivw = AnalyticsEngine::track('IVW', AnalyticsEngine::EVENT_PAGEVIEW); } $this->mainSassFile = 'skins/oasis/css/oasis.scss'; if (!empty($wgEnableAdminDashboardExt) && AdminDashboardLogic::displayAdminDashboard($this->app, $wgTitle)) { $this->displayAdminDashboard = true; } else { $this->displayAdminDashboard = false; } wfProfileOut(__METHOD__); }