Exemplo n.º 1
0
 /**
  * Main page for Special:Css page
  * 
  * @return boolean
  */
 public function index()
 {
     wfProfileIn(__METHOD__);
     if ($this->checkPermissions()) {
         $this->displayRestrictionError();
         wfProfileOut(__METHOD__);
         return false;
         // skip rendering
     }
     if ($this->wg->User->isBlocked()) {
         $block = $this->wg->User->mBlock;
         wfProfileOut(__METHOD__);
         throw new UserBlockedError($block);
     }
     $model = $this->getModel();
     $this->cssFileInfo = $model->getCssFileInfo();
     if ($this->request->wasPosted()) {
         $content = $this->request->getVal('cssContent', '');
         /** @var $status Status */
         $status = $model->saveCssFileContent($content, $this->request->getVal('editSummary', ''), $this->request->getVal('minorEdit', '') != '', $this->request->getVal('lastEditTimestamp', false), $this->wg->user);
         if (!$status) {
             BannerNotificationsController::addConfirmation(wfMessage('special-css-merge-error')->escaped(), BannerNotificationsController::CONFIRMATION_ERROR);
             $this->diff = $this->app->sendRequest(__CLASS__, 'getDiff', ['wikitext' => $content])->getVal('diff');
         } else {
             if ($status->isOk()) {
                 BannerNotificationsController::addConfirmation(wfMessage('special-css-save-message')->escaped());
                 $this->wg->Out->redirect($this->specialPage->getTitle()->getLocalURL());
                 wfProfileOut(__METHOD__);
                 return false;
                 // skip rendering
             } else {
                 BannerNotificationsController::addConfirmation($status->getMessage(), BannerNotificationsController::CONFIRMATION_ERROR);
                 $this->cssContent = $content;
             }
         }
     }
     if ($this->request->getVal('oldid', null) !== null) {
         BannerNotificationsController::addConfirmation(wfMessage('special-css-oldid-message')->escaped(), BannerNotificationsController::CONFIRMATION_WARN);
     }
     // get url and number of comments for Talk button
     $service = new PageStatsService($model->getCssFileArticleId());
     $this->cssFileTitle = $model->getCssFileTitle();
     $this->cssFileCommentsCount = $service->getCommentsCount();
     $this->cssUpdates = $model->getCssUpdatesData();
     $this->cssUpdatesUrl = $model->getCssUpdatesUrl();
     $this->dropdown = $this->createButtonLinks();
     $this->handleAssets();
     $this->minorDefault = $model->isMinorEditDefault();
     $this->wg->Out->setPageTitle($this->wf->Message('special-css-title')->plain());
     $this->wg->SuppressSpotlights = true;
     wfProfileOut(__METHOD__);
     return true;
 }
 /**
  * Prepare data for edit actions
  * @return array
  */
 private function editActionsData()
 {
     global $wgUser, $wgTitle;
     $contentActions = $this->app->getSkinTemplateObj()->data['content_actions'];
     $editActions = [];
     if (isset($contentActions['edit'])) {
         array_push($editActions, 'edit');
     } else {
         if (isset($contentActions['viewsource'])) {
             array_push($editActions, 'viewsource');
         }
     }
     if (isset($contentActions['ve-edit'])) {
         if ($contentActions['ve-edit']['main']) {
             array_unshift($editActions, 've-edit');
         } else {
             array_push($editActions, 've-edit');
         }
     }
     $allowedActions = array_merge($editActions, ['history', 'move', 'protect', 'unprotect', 'delete', 'undelete', 'replace-file', 'talk']);
     $actions = [];
     foreach ($allowedActions as $action) {
         if (isset($contentActions[$action])) {
             $contentAction = $contentActions[$action];
             $data = ['href' => $contentAction['href'], 'title' => $contentAction['text'], 'id' => $contentAction['id'], 'accesskey' => $contentAction['accesskey']];
             // Check if edit or viewsource link should be displayed.
             // In case of viewsource without namespace and cascade protection
             // we don't want to display user login modal
             if ($action == 'viewsource' && $wgUser->isAnon() && !$wgUser->isBlocked() && !$wgTitle->userCan('edit') && !$wgTitle->isProtected() && !$wgTitle->isNamespaceProtected($wgUser) && !$wgTitle->isCascadeProtected()) {
                 $data['title'] = wfMessage('edit')->text();
                 $data['class'] = 'force-user-login';
             }
             //Add custom values if talk item found
             if ($contentAction['id'] == 'ca-talk') {
                 $service = new PageStatsService($wgTitle->getArticleId());
                 $count = $service->getCommentsCount();
                 $commentsTalk = $this->sendRequest('CommentsLikes', 'getData', ['count' => $count])->getVal('data');
                 $data['title'] = $commentsTalk['title'] . " <span class='comments-talk-counter'>" . $commentsTalk['formattedCount'] . "</span>";
                 $data['href'] = $commentsTalk['href'];
                 $data['tooltip'] = $commentsTalk['title'];
                 $data['rawTitle'] = true;
             }
             if (isset($contentAction['rel'])) {
                 $data['rel'] = str_replace('ca-', '', $contentAction['rel']);
             }
             $actions[] = $data;
         }
     }
     return ['id' => 'editActionsDropdown', 'sections' => $actions];
 }
 /**
  * Render header for blog post
  */
 public function executeBlogPost()
 {
     wfProfileIn(__METHOD__);
     global $wgTitle, $wgLang, $wgOut;
     // remove User_blog:xxx from title
     $titleParts = explode('/', $wgTitle->getText());
     array_shift($titleParts);
     $this->title = implode('/', $titleParts);
     // get user name to display in header
     $this->userName = self::getUserName($wgTitle, BodyController::getUserPagesNamespaces());
     // render avatar (48x48)
     $this->avatar = AvatarService::renderAvatar($this->userName, 48);
     // link to user page
     $this->userPage = AvatarService::getUrl($this->userName);
     if ($this->wg->EnableBlogArticles) {
         // link to user blog page
         $this->userBlogPage = AvatarService::getUrl($this->userName, NS_BLOG_ARTICLE);
         // user blog page message
         $this->userBlogPageMessage = wfMessage('user-blog-url-link', $this->userName)->inContentLanguage()->parse();
     }
     if (!empty($this->wg->EnableGoogleAuthorInfo) && !empty($this->wg->GoogleAuthorLinks) && array_key_exists($this->userName, $this->wg->GoogleAuthorLinks)) {
         $this->googleAuthorLink = $this->wg->GoogleAuthorLinks[$this->userName] . '?rel=author';
     }
     if ($this->app->wg->Request->getVal('action') == 'history' || $this->app->wg->Request->getCheck('diff')) {
         $this->navLinks = Wikia::link($this->app->wg->title, wfMsg('oasis-page-header-back-to-article'), array(), array(), 'known');
     }
     // user stats (edit points, account creation date)
     $this->stats = $this->getStats($this->userName);
     // commments / likes / date of first edit
     if (!empty($wgTitle) && $wgTitle->exists()) {
         $service = new PageStatsService($wgTitle->getArticleId());
         $this->editTimestamp = $wgLang->date($service->getFirstRevisionTimestamp());
         $this->comments = $service->getCommentsCount();
     }
     $actionMenu = array();
     $dropdownActions = array('move', 'protect', 'unprotect', 'delete', 'undelete', 'history');
     // edit button / dropdown
     if (isset($this->content_actions['ve-edit'])) {
         // new visual editor is enabled
         $actionMenu['action'] = $this->content_actions['ve-edit'];
         // add classic editor link to the possible dropdown options
         array_unshift($dropdownActions, 'edit');
     } else {
         if (isset($this->content_actions['edit'])) {
             $actionMenu['action'] = $this->content_actions['edit'];
         }
     }
     foreach ($dropdownActions as $action) {
         if (isset($this->content_actions[$action])) {
             $actionMenu['dropdown'][$action] = $this->content_actions[$action];
         }
     }
     $this->actionMenu = $actionMenu;
     // load CSS for .WikiaUserPagesHeader (BugId:9212, 10246)
     $wgOut->addStyle(AssetsManager::getInstance()->getSassCommonURL("skins/oasis/css/core/UserPagesHeader.scss"));
     wfProfileOut(__METHOD__);
 }
Exemplo n.º 4
0
 /**
  * Render header for edit page
  */
 public function executeEditPage()
 {
     global $wgTitle, $wgRequest, $wgSuppressToolbar, $wgShowMyToolsOnly, $wgEnableWallExt;
     wfProfileIn(__METHOD__);
     // special handling for special pages (CreateBlogPost, CreatePage)
     $ns = $wgTitle->getNamespace();
     if ($ns == NS_SPECIAL) {
         wfProfileOut(__METHOD__);
         return;
     }
     // detect section edit
     $isSectionEdit = is_numeric($wgRequest->getVal('section'));
     // show proper message in the header
     $action = $wgRequest->getVal('action', 'view');
     $isPreview = $wgRequest->getCheck('wpPreview') || $wgRequest->getCheck('wpLivePreview');
     $isShowChanges = $wgRequest->getCheck('wpDiff');
     $isDiff = !is_null($wgRequest->getVal('diff'));
     // RT #69931
     $isEdit = in_array($action, array('edit', 'submit'));
     $isHistory = $action == 'history';
     /** start of wikia changes @author nAndy */
     $this->isHistory = $isHistory;
     $this->isUserTalkArchiveModeEnabled = !empty($wgEnableWallExt) && $ns == NS_USER_TALK;
     /** end of wikia changes */
     // add editor's right rail when not editing main page
     if (!Wikia::isMainPage()) {
         OasisController::addBodyClass('editor-rail');
     }
     // hide floating toolbar when on edit page / in preview mode / show changes
     if ($isEdit || $isPreview) {
         $wgSuppressToolbar = true;
     }
     // choose header message
     if ($isPreview) {
         $titleMsg = 'oasis-page-header-preview';
     } else {
         if ($isShowChanges) {
             $titleMsg = 'oasis-page-header-changes';
         } else {
             if ($isDiff) {
                 $titleMsg = 'oasis-page-header-diff';
             } else {
                 if ($isSectionEdit) {
                     $titleMsg = 'oasis-page-header-editing-section';
                 } else {
                     if ($isHistory) {
                         $titleMsg = 'oasis-page-header-history';
                     } else {
                         $titleMsg = 'oasis-page-header-editing';
                     }
                 }
             }
         }
     }
     $this->displaytitle = true;
     $this->title = wfMsg($titleMsg, htmlspecialchars($wgTitle->getPrefixedText()));
     // back to article link
     if (!$isPreview && !$isShowChanges) {
         $this->subtitle = Wikia::link($wgTitle, wfMsg('oasis-page-header-back-to-article'), array('accesskey' => 'c'), array(), 'known');
     }
     // add edit button
     if ($isDiff || $isHistory && !$this->isUserTalkArchiveModeEnabled) {
         $this->prepareActionButton();
         // show only "My Tools" dropdown on toolbar
         $wgShowMyToolsOnly = true;
     }
     // render edit dropdown / commments chicklet on history pages
     if ($isHistory) {
         // FB#1137 - re-add missing log and undelete links
         $logPage = SpecialPage::getTitleFor('Log');
         $this->subtitle .= ' | ' . Wikia::link($logPage, wfMsgHtml('viewpagelogs'), array(), array('page' => $wgTitle->getPrefixedText()), array('known', 'noclasses'));
         // FIXME: Skin is now an abstract class (MW1.19)
         // (wladek) created non-abstract FakeSkin class, is it the correct solution?
         $sk = new FakeSkin();
         $sk->setRelevantTitle($wgTitle);
         $undeleteLink = $sk->getUndeleteLink();
         if (!empty($undeleteLink)) {
             $this->subtitle .= ' | ' . $undeleteLink;
         }
         // dropdown actions
         $this->dropdown = $this->getDropdownActions();
         // use service to get data
         $service = new PageStatsService($wgTitle->getArticleId());
         // comments
         $this->comments = $service->getCommentsCount();
     }
     wfRunHooks('PageHeaderEditPage', array(&$this, $ns, $isPreview, $isShowChanges, $isDiff, $isEdit, $isHistory));
     wfProfileOut(__METHOD__);
 }
Exemplo n.º 5
0
	function testPageStatsService() {
		global $wgTitle, $wgMemc;

		$wgTitle = Title::newMainPage();
		$articleId = $wgTitle->getArticleId();
		$article = Article::newFromId($articleId);
		$key = wfMemcKey('services', 'pageheader', 'current-revision', $articleId);

		// macbre: perform this test only for existing pages
		if (!$wgTitle->exists()) {
			$this->markTestSkipped('Main page cannot be found');
			return;
		}

		$service = new PageStatsService($articleId);

		$this->assertType('array', $service->getMostLinkedCategories());
		$this->assertType('int', $service->getCommentsCount());
		$this->assertType('int', $service->getLikesCount());
		$this->assertType('array', $service->getCurrentRevision());
		$this->assertType('array', $service->getPreviousEdits());
		$this->assertType('string', $service->getFirstRevisionTimestamp());

		// comments counter regenerating
		$comments = $service->getCommentsCount();

		$service->regenerateCommentsCount();
		$this->assertEquals($comments, $service->getCommentsCount());

		// remove cached stats when article is edited
		$user = $flags = $status = false;
		PageStatsService::onArticleSaveComplete($article, $user, false, false, false, false, false, $flags, false, $status, false);

		$data = $wgMemc->get($key);
		$this->assertTrue(empty($data));

		$service->getCurrentRevision();

		$data = $wgMemc->get($key);
		$this->assertFalse(empty($data));

		// remove cached stats when article (comment) is deleted
		PageStatsService::onArticleDeleteComplete($article, $user, false, $articleId);

		$data = $wgMemc->get($key);
		$this->assertTrue(empty($data));

		$service->getCurrentRevision();

		// regenerate data
		$service->regenerateData();

		$data = $wgMemc->get($key);
		$this->assertTrue(empty($data));
	}
Exemplo n.º 6
0
 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__);
 }
	/**
	 * Render header for blog post
	 */
	public function executeBlogPost() {
		wfProfileIn(__METHOD__);
		global $wgTitle, $wgLang, $wgOut;

		// remove User_blog:xxx from title
		$titleParts = explode('/', $wgTitle->getText());
		array_shift($titleParts);
		$this->title = implode('/', $titleParts);

		// get user name to display in header
		$this->userName = self::getUserName($wgTitle, BodyController::getUserPagesNamespaces());

		// render avatar (48x48)
		$this->avatar = AvatarService::renderAvatar($this->userName, 48);

		// link to user page
		$this->userPage = AvatarService::getUrl($this->userName);

		// user stats (edit points, account creation date)
		$this->stats = $this->getStats($this->userName);

		// commments / likes / date of first edit
		if (!empty($wgTitle) && $wgTitle->exists()) {
			$service = new PageStatsService($wgTitle->getArticleId());

			$this->editTimestamp = $wgLang->date($service->getFirstRevisionTimestamp());
			$this->comments = $service->getCommentsCount();
			$this->likes = true;
		}

		$actionMenu = array();
		// edit button / dropdown
		if (isset($this->content_actions['edit'])) {
			$actionMenu['action'] = $this->content_actions['edit'];
		}

		// dropdown actions
		$actions = array('move', 'protect', 'unprotect', 'delete', 'undelete', 'history');
		foreach($actions as $action) {
			if (isset($this->content_actions[$action])) {
				$actionMenu['dropdown'][$action] = $this->content_actions[$action];
			}
		}
		$this->actionMenu = $actionMenu;

		// load CSS for .WikiaUserPagesHeader (BugId:9212, 10246)
		$wgOut->addStyle(AssetsManager::getInstance()->getSassCommonURL("skins/oasis/css/core/UserPagesHeader.scss"));

		wfProfileOut(__METHOD__);
	}
Exemplo n.º 8
0
	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__);
	}