public function executeIndex()
 {
     OasisController::addBodyClass('wikinav2');
     $themeSettings = new ThemeSettings();
     $settings = $themeSettings->getSettings();
     $this->wordmarkText = $settings["wordmark-text"];
     $this->wordmarkType = $settings["wordmark-type"];
     $this->wordmarkSize = $settings["wordmark-font-size"];
     $this->wordmarkFont = $settings["wordmark-font"];
     if ($this->wordmarkType == "graphic") {
         wfProfileIn(__METHOD__ . 'graphicWordmarkV2');
         $this->wordmarkUrl = $themeSettings->getWordmarkUrl();
         $imageTitle = Title::newFromText($themeSettings::WordmarkImageName, NS_IMAGE);
         if ($imageTitle instanceof Title) {
             $attributes = array();
             $file = wfFindFile($imageTitle);
             if ($file instanceof File) {
                 $attributes[] = 'width="' . $file->width . '"';
                 $attributes[] = 'height="' . $file->height . '"';
                 if (!empty($attributes)) {
                     $this->wordmarkStyle = ' ' . implode(' ', $attributes) . ' ';
                 }
             }
         }
         wfProfileOut(__METHOD__ . 'graphicWordmarkV2');
     }
     $this->mainPageURL = Title::newMainPage()->getLocalURL();
     $this->displaySearch = !empty($this->wg->EnableAdminDashboardExt) && AdminDashboardLogic::displayAdminDashboard($this, $this->wg->Title);
     $this->setVal('displayHeader', !$this->wg->HideNavigationHeaders);
     $this->displayHeaderButtons = !WikiaPageType::isWikiaHubMain();
 }
	public function executeIndex() {
		OasisController::addBodyClass('wikinav2');

		$themeSettings = new ThemeSettings();
		$settings = $themeSettings->getSettings();

		$this->wordmarkText = $settings["wordmark-text"];
		$this->wordmarkType = $settings["wordmark-type"];
		$this->wordmarkSize = $settings["wordmark-font-size"];
		$this->wordmarkFont = $settings["wordmark-font"];

		if ($this->wordmarkType == "graphic") {
			wfProfileIn(__METHOD__ . 'graphicWordmarkV2');
			$this->wordmarkUrl = wfReplaceImageServer($settings['wordmark-image-url'], SassUtil::getCacheBuster());
			$imageTitle = Title::newFromText($themeSettings::WordmarkImageName,NS_IMAGE);
			if($imageTitle instanceof Title) {
				$attributes = array();
				$file = wfFindFile($imageTitle);
				if($file instanceof File) {
					$attributes []= 'width="' . $file->width . '"';
					$attributes []= 'height="' . $file->height. '"';
			
					if(!empty($attributes)) {
						$this->wordmarkStyle = ' ' . implode(' ',$attributes) . ' ';
					}
				}
			}
			wfProfileOut(__METHOD__. 'graphicWordmarkV2');
		}

		$this->mainPageURL = Title::newMainPage()->getLocalURL();
		
		$this->displaySearch = !empty($this->wg->EnableAdminDashboardExt) && AdminDashboardLogic::displayAdminDashboard($this, $this->wg->Title);
	}
	public function executeIndex() {
		global $wgCityId, $wgUser, $wgIsPrivateWiki, $wgEnableAdminDashboardExt, $wgTitle;

		//fb#1090
		$this->isInternalWiki = empty($wgCityId);
		$this->showMenu = !(($this->isInternalWiki || $wgIsPrivateWiki) && $wgUser->isAnon());

		if($wgUser->isAllowed('editinterface')) {
			$editURL['href'] = Title::newFromText('Wiki-navigation', NS_MEDIAWIKI)->getFullURL();
			$editURL['text'] = wfMsg('oasis-edit-this-menu');
			$this->editURL = $editURL;
		}

		$service = new NavigationService();
		$this->menuNodes = $service->parseMessage('Wiki-navigation', array(4, 7, 7), 60*60*3 /* 3 hours */, true);

		$this->displaySearch = !empty($wgEnableAdminDashboardExt) && AdminDashboardLogic::displayAdminDashboard(F::app(), $wgTitle);
	}
 public function executeChrome()
 {
     global $wgRequest, $wgTitle;
     $this->tab = $wgRequest->getVal("tab", "");
     if (empty($this->tab) && $this->isAdminDashboardTitle()) {
         $this->tab = 'general';
     } else {
         if (AdminDashboardLogic::isGeneralApp(array_shift(SpecialPageFactory::resolveAlias($wgTitle->getDBKey())))) {
             $this->tab = 'general';
         } else {
             if (empty($this->tab)) {
                 $this->tab = 'advanced';
             }
         }
     }
     $this->response->addAsset('extensions/wikia/AdminDashboard/css/AdminDashboard.scss');
     $this->response->addAsset('extensions/wikia/AdminDashboard/js/AdminDashboard.js');
     $this->isAdminDashboard = $this->isAdminDashboardTitle();
     $this->adminDashboardUrl = Title::newFromText('AdminDashboard', NS_SPECIAL)->getFullURL("tab={$this->tab}");
     $this->adminDashboardUrlGeneral = Title::newFromText('AdminDashboard', NS_SPECIAL)->getFullURL("tab=general");
     $this->adminDashboardUrlAdvanced = Title::newFromText('AdminDashboard', NS_SPECIAL)->getFullURL("tab=advanced");
 }
 public function executeChrome()
 {
     global $wgRequest, $wgTitle;
     $adminDashboardTitle = Title::newFromText('AdminDashboard', NS_SPECIAL);
     $this->isAdminDashboard = $wgTitle->getText() == $adminDashboardTitle->getText();
     $this->tab = $wgRequest->getVal("tab", "");
     if (empty($this->tab) && $this->isAdminDashboard) {
         $this->tab = 'general';
     } else {
         if (AdminDashboardLogic::isGeneralApp(array_shift(SpecialPageFactory::resolveAlias($wgTitle->getDBKey())))) {
             $this->tab = 'general';
         } else {
             if (empty($this->tab)) {
                 $this->tab = 'advanced';
             }
         }
     }
     $this->wg->Out->addStyle(AssetsManager::getInstance()->getSassCommonURL('extensions/wikia/AdminDashboard/css/AdminDashboard.scss'));
     $this->wg->Out->addScriptFile($this->wg->ExtensionsPath . '/wikia/AdminDashboard/js/AdminDashboard.js');
     $this->adminDashboardUrl = Title::newFromText('AdminDashboard', NS_SPECIAL)->getFullURL("tab={$this->tab}");
     $this->adminDashboardUrlGeneral = Title::newFromText('AdminDashboard', NS_SPECIAL)->getFullURL("tab=general");
     $this->adminDashboardUrlAdvanced = Title::newFromText('AdminDashboard', NS_SPECIAL)->getFullURL("tab=advanced");
 }
 /**
  * @brief Copied and pasted code from wfSpecialSpecialpages() that have been modified and refactored.  Also removes some special pages from list.
  *
  */
 public function getAdvancedSection()
 {
     if (!$this->wg->User->isAllowed('admindashboard')) {
         $this->displayRestrictionError();
         return false;
         // skip rendering
     }
     $this->sk = $this->wg->User->getSkin();
     $pages = SpecialPageFactory::getUsablePages();
     if (count($pages) == 0) {
         return;
     }
     /** Put them into a sortable array */
     $groups = array();
     foreach ($pages as $pagename => $page) {
         if (!AdminDashboardLogic::isGeneralApp($pagename) && $page->isListed()) {
             $group = SpecialPageFactory::getGroup($page);
             if (!isset($groups[$group])) {
                 $groups[$group] = array();
             }
             $groups[$group][$page->getDescription()] = array($page->getTitle(), $page->isRestricted());
         }
     }
     /** Sort */
     if ($this->wg->SortSpecialPages) {
         foreach ($groups as $group => $sortedPages) {
             ksort($groups[$group]);
         }
     }
     /** Always move "other" to end */
     if (array_key_exists('other', $groups)) {
         $other = $groups['other'];
         unset($groups['other']);
         $groups['other'] = $other;
     }
     $this->groups = $groups;
 }
 public function executeIndex()
 {
     global $wgOut, $wgTitle, $wgEnableInfoBoxTest, $wgMaximizeArticleAreaArticleIds, $wgEnableAdminDashboardExt, $wgEnableWikiaHomePageExt;
     wfProfileIn(__METHOD__);
     // set up global vars
     if (is_array($wgMaximizeArticleAreaArticleIds) && in_array($wgTitle->getArticleId(), $wgMaximizeArticleAreaArticleIds)) {
         $this->wg->SuppressRail = true;
         $this->wg->SuppressPageHeader = true;
     }
     // Double-click to edit
     $this->body_ondblclick = '';
     // FIXME handling moved to OutputPage::addDefaultModules()
     // InfoBox - Testing
     $this->wg->EnableInfoBoxTest = $wgEnableInfoBoxTest;
     // Replaces ContentDisplayModule->index()
     $this->bodytext = $this->app->getSkinTemplateObj()->data['bodytext'];
     $this->railModuleList = $this->getRailModuleList();
     // this hook allows adding extra HTML just after <body> opening tag
     // append your content to $html variable instead of echoing
     // (taken from Monaco skin)
     $skin = RequestContext::getMain()->getSkin();
     $afterBodyHtml = '';
     wfRunHooks('GetHTMLAfterBody', array($skin, &$afterBodyHtml));
     $this->afterBodyHtml = $afterBodyHtml;
     // this hook is needed for SMW's factbox
     $afterContentHookText = '';
     wfRunHooks('SkinAfterContent', array(&$afterContentHookText));
     $this->afterContentHookText = $afterContentHookText;
     $this->headerModuleAction = 'Index';
     $this->headerModuleParams = array('showSearchBox' => false);
     // show user pages header on this page?
     if (self::showUserPagesHeader()) {
         $this->headerModuleName = 'UserPagesHeader';
         // is this page a blog post?
         if (self::isBlogPost()) {
             $this->headerModuleAction = 'BlogPost';
         } else {
             if (self::isBlogListing()) {
                 $this->headerModuleAction = 'BlogListing';
             }
         }
         // show corporate header on this page?
     } else {
         if (WikiaPageType::isCorporatePage() || WikiaPageType::isWikiaHub()) {
             $this->headerModuleName = 'PageHeader';
             if (self::isEditPage()) {
                 $this->headerModuleAction = 'EditPage';
             } else {
                 $this->headerModuleAction = 'Corporate';
             }
             if (WikiaPageType::isWikiaHubMain()) {
                 $this->headerModuleAction = 'Hubs';
             } elseif (WikiaPageType::isMainPage()) {
                 $this->wg->SuppressFooter = true;
                 $this->wg->SuppressArticleCategories = true;
                 $this->wg->SuppressPageHeader = true;
                 $this->wg->SuppressWikiHeader = true;
                 $this->wg->SuppressSlider = true;
             }
         } else {
             $this->headerModuleName = 'PageHeader';
             if (self::isEditPage()) {
                 $this->headerModuleAction = 'EditPage';
             }
         }
     }
     // Display Control Center Header on certain special pages
     if (!empty($wgEnableAdminDashboardExt) && AdminDashboardLogic::displayAdminDashboard($this->app, $wgTitle)) {
         $this->headerModuleName = null;
         $this->wgSuppressAds = true;
         $this->displayAdminDashboard = true;
         $this->displayAdminDashboardChromedArticle = $wgTitle->getText() != SpecialPage::getTitleFor('AdminDashboard')->getText();
     } else {
         $this->displayAdminDashboard = false;
         $this->displayAdminDashboardChromedArticle = false;
     }
     $this->railModulesExist = true;
     // use one column layout for pages with no right rail modules
     if (count($this->railModuleList) == 0 || !empty($this->wg->SuppressRail)) {
         // Special:AdminDashboard doesn't need this class, but pages chromed with it do
         if (!$this->displayAdminDashboard || $this->displayAdminDashboardChromedArticle) {
             OasisController::addBodyClass('oasis-one-column');
         }
         $this->headerModuleParams = array('showSearchBox' => true);
         $this->railModulesExist = false;
     }
     // determine if WikiaGridLayout needs to be enabled
     $this->isGridLayoutEnabled = self::isGridLayoutEnabled();
     if ($this->isGridLayoutEnabled) {
         OasisController::addBodyClass('wikia-grid');
     }
     if ($this->isOasisBreakpoints()) {
         OasisController::addBodyClass('oasis-breakpoints');
     }
     //@TODO remove this check after deprecating responsive (July 2015)
     if ($this->isResponsiveLayoutEnabled()) {
         OasisController::addBodyClass('oasis-responsive');
     }
     // if we are on a special search page, pull in the css file and don't render a header
     if ($wgTitle && $wgTitle->isSpecial('Search') && !$this->wg->WikiaSearchIsDefault) {
         $wgOut->addStyle(AssetsManager::getInstance()->getSassCommonURL("skins/oasis/css/modules/SpecialSearch.scss"));
         $this->headerModuleName = null;
     }
     // Inter-wiki search
     if ($wgTitle && ($wgTitle->isSpecial('WikiaSearch') || $wgTitle->isSpecial('Search') && $this->wg->WikiaSearchIsDefault)) {
         $this->headerModuleName = null;
     }
     // load CSS for Special:Preferences
     if (!empty($wgTitle) && $wgTitle->isSpecial('Preferences')) {
         $wgOut->addStyle(AssetsManager::getInstance()->getSassCommonURL('skins/oasis/css/modules/SpecialPreferences.scss'));
     }
     // load CSS for Special:Upload
     if (!empty($wgTitle) && $wgTitle->isSpecial('Upload')) {
         $wgOut->addStyle(AssetsManager::getInstance()->getSassCommonURL('skins/oasis/css/modules/SpecialUpload.scss'));
     }
     // load CSS for Special:MultipleUpload
     if (!empty($wgTitle) && $wgTitle->isSpecial('MultipleUpload')) {
         $wgOut->addStyle(AssetsManager::getInstance()->getSassCommonURL('skins/oasis/css/modules/SpecialMultipleUpload.scss'));
     }
     // load CSS for Special:Allpages
     if (!empty($wgTitle) && $wgTitle->isSpecial('Allpages')) {
         $wgOut->addStyle(AssetsManager::getInstance()->getSassCommonURL('skins/oasis/css/modules/SpecialAllpages.scss'));
     }
     // Forum Extension
     if (!empty($this->wg->EnableForumExt) && ForumHelper::isForum()) {
         $this->wg->SuppressPageHeader = true;
     }
     // MonetizationModule Extension
     if (!empty($this->wg->EnableMonetizationModuleExt)) {
         if (empty($this->wg->AdDriverUseMonetizationService)) {
             $this->monetizationModules = $this->sendRequest('MonetizationModule', 'index')->getData()['data'];
             $this->headerModuleParams['monetizationModules'] = $this->monetizationModules;
         } else {
             $this->monetizationModules = [MonetizationModuleHelper::SLOT_TYPE_IN_CONTENT => $this->app->renderView('Ad', 'Index', ['slotName' => 'MON_IN_CONTENT']), MonetizationModuleHelper::SLOT_TYPE_BELOW_CATEGORY => $this->app->renderView('Ad', 'Index', ['slotName' => 'MON_BELOW_CATEGORY'])];
         }
         $this->bodytext = MonetizationModuleHelper::insertIncontentUnit($this->bodytext, $this->monetizationModules);
     }
     $namespace = $wgTitle->getNamespace();
     // extra logic for subpages (RT #74091)
     if (!empty($this->subtitle)) {
         switch ($namespace) {
             // for user subpages add link to theirs talk pages
             case NS_USER:
                 $talkPage = $wgTitle->getTalkPage();
                 // get number of revisions for talk page
                 $service = new PageStatsService($wgTitle->getArticleId());
                 $comments = $service->getCommentsCount();
                 // render comments bubble
                 $bubble = F::app()->renderView('CommentsLikes', 'Index', array('comments' => $comments, 'bubble' => true));
                 $this->subtitle .= ' | ';
                 $this->subtitle .= $bubble;
                 $this->subtitle .= Wikia::link($talkPage);
                 break;
             case NS_USER_TALK:
                 $subjectPage = $wgTitle->getSubjectPage();
                 $this->subtitle .= ' | ';
                 $this->subtitle .= Wikia::link($subjectPage);
                 break;
         }
     }
     // bugid-70243: optionally hide navigation h1s for SEO
     $this->setVal('displayHeader', !$this->wg->HideNavigationHeaders);
     wfProfileOut(__METHOD__);
 }
 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__);
 }
	public function executeIndex() {
		global $wgOut, $wgTitle, $wgUser, $wgEnableCorporatePageExt, $wgEnableInfoBoxTest, $wgMaximizeArticleAreaArticleIds, $wgEnableAdminDashboardExt, $wgEnableTopButton, $wgTopButtonPosition, $wgEnableWikiaHomePageExt;

		wfProfileIn(__METHOD__);

		// set up global vars
		if (is_array($wgMaximizeArticleAreaArticleIds)
		&& in_array($wgTitle->getArticleId(), $wgMaximizeArticleAreaArticleIds)) {
			$this->wg->SuppressRail = true;
			$this->wg->SuppressPageHeader = true;
		}

		// Double-click to edit
		$this->body_ondblclick = ''; // FIXME handling moved to OutputPage::addDefaultModules()

		// InfoBox - Testing
		$this->wg->EnableInfoBoxTest = $wgEnableInfoBoxTest;
		$this->isMainPage = WikiaPageType::isMainPage();

		// Replaces ContentDisplayModule->index()
		$this->bodytext = $this->app->getSkinTemplateObj()->data['bodytext'];

		$this->railModuleList = $this->getRailModuleList();
		// this hook allows adding extra HTML just after <body> opening tag
		// append your content to $html variable instead of echoing
		// (taken from Monaco skin)
		$skin = RequestContext::getMain()->getSkin();
		$afterBodyHtml = '';
		wfRunHooks('GetHTMLAfterBody', array($skin, &$afterBodyHtml));
		$this->afterBodyHtml = $afterBodyHtml;

		// this hook is needed for SMW's factbox
		$afterContentHookText = '';
		wfRunHooks('SkinAfterContent', array( &$afterContentHookText ) );
		$this->afterContentHookText = $afterContentHookText;

		$this->headerModuleAction = 'Index';
		$this->headerModuleParams = array ('showSearchBox' => false);

		// show user pages header on this page?
		if (self::showUserPagesHeader()) {
			$this->headerModuleName = 'UserPagesHeader';
			// is this page a blog post?
			if( self::isBlogPost() ) {
				$this->headerModuleAction = 'BlogPost';
			}
			// is this page a blog listing?
			else if (self::isBlogListing()) {
				$this->headerModuleAction = 'BlogListing';
			}
		} else {
			$this->headerModuleName = 'PageHeader';
			if (self::isEditPage()) {
				$this->headerModuleAction = 'EditPage';
			}

			// FIXME: move to separate module
			if ( $wgEnableWikiaHomePageExt && WikiaPageType::isMainPage() ) {
				$this->wg->SuppressFooter = true;
				$this->wg->SuppressArticleCategories = true;
				$this->wg->SuppressPageHeader = true;
				$this->wg->SuppressWikiHeader = true;
				$this->wg->SuppressSlider = true;
			} else if ($wgEnableCorporatePageExt) {
				// RT:71681 AutoHubsPages extension is skipped when follow is clicked

				$wgOut->addStyle(AssetsManager::getInstance()->getSassCommonURL("extensions/wikia/CorporatePage/css/CorporateSite.scss"));

				global $wgExtensionsPath, $wgJsMimeType;
				$wgOut->addScript("<script src=\"{$wgExtensionsPath}/wikia/CorporatePage/js/CorporateSlider.js\" type=\"{$wgJsMimeType}\"></script>");

				// $this->wgSuppressFooter = true;
				$this->wgSuppressArticleCategories = true;
				if (WikiaPageType::isMainPage()) {
					$this->wg->SuppressPageHeader = true;
				} else {
					$this->headerModuleAction = 'Corporate';
				}
			}
		}

		$this->railModulesExist = true;

		// use one column layout for pages with no right rail modules
		if( count($this->railModuleList ) == 0 || !empty($this->wg->SuppressRail) ) {
			OasisController::addBodyClass('oasis-one-column');
			$this->headerModuleParams = array ('showSearchBox' => true);
			$this->railModulesExist = false;
		}

		// determine if WikiaGridLayout needs to be enabled
		$this->isGridLayoutEnabled = self::isGridLayoutEnabled();
		if($this->isGridLayoutEnabled) {
			OasisController::addBodyClass('wikia-grid');
		}

		// if we are on a special search page, pull in the css file and don't render a header
		if($wgTitle && $wgTitle->isSpecial( 'Search' ) && !$this->wg->WikiaSearchIsDefault) {
			$wgOut->addStyle(AssetsManager::getInstance()->getSassCommonURL("skins/oasis/css/modules/SpecialSearch.scss"));
			$this->headerModuleName = null;
			$this->bodytext = F::app()->renderView('Search', "Index'") . $this->bodytext;
		}

		// Inter-wiki search
		if($wgTitle && ($wgTitle->isSpecial( 'WikiaSearch' ) || ($wgTitle->isSpecial( 'Search' ) && $this->wg->WikiaSearchIsDefault ))) {
			$this->headerModuleName = null;
		}

		// load CSS for Special:Preferences
		if (!empty($wgTitle) && $wgTitle->isSpecial('Preferences')) {
			$wgOut->addStyle(AssetsManager::getInstance()->getSassCommonURL('skins/oasis/css/modules/SpecialPreferences.scss'));
		}

		// load CSS for Special:Upload
		if (!empty($wgTitle) && $wgTitle->isSpecial('Upload')) {
			$wgOut->addStyle(AssetsManager::getInstance()->getSassCommonURL('skins/oasis/css/modules/SpecialUpload.scss'));
		}

		// load CSS for Special:Allpages
		if (!empty($wgTitle) && $wgTitle->isSpecial('Allpages')) {
			$wgOut->addStyle(AssetsManager::getInstance()->getSassCommonURL('skins/oasis/css/modules/SpecialAllpages.scss'));
		}

		// Display Control Center Header on certain special pages
		if (!empty($wgEnableAdminDashboardExt) && AdminDashboardLogic::displayAdminDashboard($this->app, $wgTitle)) {
			$this->headerModuleName = null;
			$this->wgSuppressAds = true;
			$this->displayAdminDashboard = true;
			$this->displayAdminDashboardChromedArticle = ($wgTitle->getText() != Title::newFromText("AdminDashboard", NS_SPECIAL)->getText());
		} else {
			$this->displayAdminDashboard = false;
			$this->displayAdminDashboardChromedArticle = false;
		}

		// Forum Extension
		if (!empty($this->wg->EnableForumExt) && !empty($this->wg->IsForum)) {
			$this->wg->SuppressPageHeader = true;
		}

		$namespace = $wgTitle->getNamespace();
		// extra logic for subpages (RT #74091)
		if (!empty($this->subtitle)) {
			switch($namespace) {
				// for user subpages add link to theirs talk pages
				case NS_USER:
					$talkPage = $wgTitle->getTalkPage();

					// get number of revisions for talk page
					$service = new PageStatsService($wgTitle->getArticleId());
					$comments = $service->getCommentsCount();

					// render comments bubble
					$bubble = F::app()->renderView('CommentsLikes', 'Index', array('comments' => $comments, 'bubble' => true));

					$this->subtitle .= ' | ';
					$this->subtitle .= $bubble;
					$this->subtitle .= Wikia::link($talkPage);
					break;

				case NS_USER_TALK:
					$subjectPage = $wgTitle->getSubjectPage();

					$this->subtitle .= ' | ';
					$this->subtitle .= Wikia::link($subjectPage);
					break;
			}
		}

		wfProfileOut(__METHOD__);
	}
	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__);
	}