public function init()
 {
     /**
      * Include Forum.scss only if
      * the method is called in a Forum context
      */
     if (ForumHelper::isForum()) {
         $this->response->addAsset('extensions/wikia/Forum/css/Forum.scss');
     }
 }
 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__);
 }
 /**
  * Check if current page is forum page (Special:Forum or forum board or forum thread)
  *
  * @return bool
  */
 public static function isForum()
 {
     $title = self::getTitle();
     return defined('NS_FORUM') && $title instanceof Title && $title->getNamespace() === NS_FORUM || F::app()->wg->EnableForumExt && ForumHelper::isForum();
 }
Beispiel #4
0
    echo $app->renderView('AdminDashboard', 'Chrome');
}
?>

		<article id="WikiaMainContent" class="WikiaMainContent<?php 
echo !empty($isGridLayoutEnabled) ? $railModulesExist ? ' grid-4' : ' grid-6' : '';
?>
">
			<?php 
if (!empty($wg->EnableMomModulesExt) && WikiaPageType::isMainPage()) {
    echo $app->renderView('Njord', 'mom');
}
?>
			<div id="WikiaMainContentContainer" class="WikiaMainContentContainer">
				<?php 
if (!empty($wg->EnableForumExt) && ForumHelper::isForum()) {
    echo $app->renderView('ForumController', 'header');
}
// render UserPagesHeader or PageHeader or nothing...
if (empty($wg->SuppressPageHeader) && $headerModuleName) {
    if ($headerModuleName == 'UserPagesHeader') {
        if ($headerModuleAction == 'BlogPost' || $headerModuleAction == 'BlogListing') {
            // Show blog post header
            echo $app->renderView($headerModuleName, $headerModuleAction, $headerModuleParams);
        } else {
            // Show just the edit button
            echo $app->renderView('UserProfilePage', 'renderActionButton', array());
        }
    } else {
        if (!$runNjord) {
            echo $app->renderView($headerModuleName, $headerModuleAction, $headerModuleParams);