public function executeSlider() { global $wgOut, $wgTitle, $wgParser; if (BodyController::isHubPage()) { $this->slider_class = "small"; $tag_name = AutoHubsPagesHelper::getHubNameFromTitle($wgTitle); // Beware: the true/false at the end is important, it actually changes the return format slightly $this->slider = CorporatePageHelper::parseMsgImg('hub-' . $tag_name . '-slider', false); // render slider's HTML using WikiaPhotoGallery (BugId:8478) $slider = new WikiaPhotoGallery(); $slider->setParser($wgParser); $wgParser->startExternalParse($wgTitle, new ParserOptions(), Parser::OT_HTML); $slider->parseParams(array('type' => 'slider', 'orientation' => 'bottom')); // add images $sliderWikitext = ''; foreach ($this->slider as $image) { // ElmoControlRoom.jpg|Label|link=http://wikia.com|linktext=Link text // if parsgMsgImg has a thumbnail or the 2nd param=true (and right now it is not) then the return vals move around if (isset($image['param'])) { // no thumbnail in msg $sliderWikitext .= "{$image['param']}|{$image['title']}|link={$image['href']}|linktext={$image['imagetitle']}\n"; } else { // has thumbnail in msg $sliderWikitext .= "{$image['imagetitle']}|{$image['title']}|link={$image['href']}|linktext={$image['desc']}\n"; } } // set the content and parse it $slider->setText($sliderWikitext); $slider->parse(); // render it $this->sliderHtml = $slider->toHTML(); } if (WikiaPageType::isMainPage()) { $this->isMainPage = true; $this->slider_class = "big"; $this->slider = CorporatePageHelper::parseMsgImg('corporatepage-slider', true); } else { $this->isMainPage = false; } }
private function configure() { global $wgTitle, $wgContentNamespaces, $wgEnableFAST_HOME2, $wgEnableCorporatePageExt, $wgExtraNamespaces; self::$config = array(); if (!AdEngine2Controller::areAdsShowableOnPage()) { return; } if(WikiaPageType::isWikiaHub() && AdEngine::isAdsEnabledOnWikiaHub()) { self::$config['HOME_TOP_LEADERBOARD'] = true; self::$config['TOP_BUTTON'] = true; return; } // Ads on corporate hub pages only elseif($wgEnableCorporatePageExt) { if (BodyController::isHubPage()) { self::$config['CORP_TOP_LEADERBOARD'] = true; self::$config['CORP_TOP_RIGHT_BOXAD'] = true; self::$config['TOP_BUTTON'] = true; } elseif (WikiaPageType::isSearch()) { if (!empty($this->wg->EnableWikiaSearchAds)) { // no regular ads if search ads are enabled } else { self::$config['TOP_LEADERBOARD'] = true; self::$config['TOP_RIGHT_BOXAD'] = true; self::$config['TOP_BUTTON'] = true; } } return; } $namespace = $wgTitle->getNamespace(); if(WikiaPageType::isMainPage()) { // main page self::$config['HOME_TOP_LEADERBOARD'] = true; self::$config['INVISIBLE_1'] = true; self::$config['INVISIBLE_2'] = true; self::$config['PREFOOTER_LEFT_BOXAD'] = true; self::$config['PREFOOTER_RIGHT_BOXAD'] = true; self::$config['HOME_INVISIBLE_TOP'] = false; // skins used to be served from this slot, but are now served from TOP_LEADERBOARD with option dcopt=ist if($wgEnableFAST_HOME2) { self::$config['HOME_TOP_RIGHT_BOXAD'] = true; self::$config['TEST_HOME_TOP_RIGHT_BOXAD'] = true; } self::$config['HOME_TOP_RIGHT_BUTTON'] = true; self::$config['TOP_BUTTON'] = true; } else { if(in_array($namespace, $wgContentNamespaces)) { // content page self::$config['TOP_LEADERBOARD'] = true; self::$config['TOP_RIGHT_BOXAD'] = true; self::$config['TEST_TOP_RIGHT_BOXAD'] = true; self::$config['MIDDLE_RIGHT_BOXAD'] = true; self::$config['INVISIBLE_1'] = true; self::$config['INVISIBLE_2'] = true; self::$config['LEFT_SKYSCRAPER_2'] = true; self::$config['LEFT_SKYSCRAPER_3'] = true; self::$config['PREFOOTER_LEFT_BOXAD'] = true; self::$config['PREFOOTER_RIGHT_BOXAD'] = true; self::$config['INVISIBLE_TOP'] = false; // skins used to be served from this slot, but are now served from TOP_LEADERBOARD with option dcopt=ist self::$config['TOP_RIGHT_BUTTON'] = true; self::$config['TOP_BUTTON'] = true; } else if($namespace == NS_FILE) { // file/image page self::$config['TOP_LEADERBOARD'] = true; self::$config['TOP_RIGHT_BOXAD'] = true; self::$config['TOP_BUTTON'] = true; } else if(WikiaPageType::isForum()) { self::$config['TOP_LEADERBOARD'] = true; self::$config['TOP_RIGHT_BOXAD'] = true; self::$config['TOP_BUTTON'] = true; self::$config['LEFT_SKYSCRAPER_3'] = true; self::$config['PREFOOTER_LEFT_BOXAD'] = true; self::$config['PREFOOTER_RIGHT_BOXAD'] = true; } else if (WikiaPageType::isSearch()) { // search results page if (empty($this->wg->EnableWikiaSearchAds)) { // regular ads if search ads are disabled self::$config['TOP_LEADERBOARD'] = true; self::$config['TOP_RIGHT_BOXAD'] = true; self::$config['TEST_TOP_RIGHT_BOXAD'] = true; self::$config['TOP_BUTTON'] = true; self::$config['LEFT_SKYSCRAPER_2'] = true; self::$config['LEFT_SKYSCRAPER_3'] = true; self::$config['PREFOOTER_LEFT_BOXAD'] = true; self::$config['PREFOOTER_RIGHT_BOXAD'] = true; } } else if($namespace == NS_SPECIAL) { if($wgTitle->isSpecial('Leaderboard')) { self::$config['TOP_LEADERBOARD'] = true; self::$config['TOP_RIGHT_BOXAD'] = true; self::$config['TOP_BUTTON'] = true; } else if($wgTitle->isSpecial('Videos')) { self::$config['TOP_LEADERBOARD'] = true; } } else if($namespace == NS_CATEGORY) { // category page self::$config['TOP_LEADERBOARD'] = true; self::$config['TOP_RIGHT_BOXAD'] = true; self::$config['TEST_TOP_RIGHT_BOXAD'] = true; self::$config['MIDDLE_RIGHT_BOXAD'] = true; self::$config['LEFT_SKYSCRAPER_2'] = true; self::$config['PREFOOTER_LEFT_BOXAD'] = true; self::$config['PREFOOTER_RIGHT_BOXAD'] = true; self::$config['TOP_BUTTON'] = true; } else if($namespace == NS_PROJECT) { self::$config['TOP_LEADERBOARD'] = true; self::$config['TOP_RIGHT_BOXAD'] = true; self::$config['TOP_BUTTON'] = true; } else if($namespace == NS_FORUM) { self::$config['TOP_LEADERBOARD'] = true; self::$config['TOP_RIGHT_BOXAD'] = true; self::$config['TOP_BUTTON'] = true; } else if( BodyController::isBlogListing() ) { self::$config['TOP_LEADERBOARD'] = true; self::$config['TOP_RIGHT_BOXAD'] = true; self::$config['TOP_BUTTON'] = true; } else if( BodyController::isBlogPost() ) { self::$config['TOP_LEADERBOARD'] = true; self::$config['TOP_RIGHT_BOXAD'] = true; self::$config['TEST_TOP_RIGHT_BOXAD'] = true; self::$config['TOP_BUTTON'] = true; } else if (array_key_exists($namespace, $wgExtraNamespaces)) { self::$config['TOP_LEADERBOARD'] = true; self::$config['TOP_BUTTON'] = true; } } }
/** * Called instead of executeIndex when the CorporatePage extension is enabled. */ public function executeCorporate() { global $wgTitle, $wgOut, $wgUser, $wgSuppressNamespacePrefix; wfProfileIn( __METHOD__ ); $this->canAct = $wgUser->isAllowed('edit'); if ( $this->canAct ) { $this->prepareActionButton(); // dropdown actions $this->dropdown = $this->getDropdownActions(); } // page namespace $ns = $wgTitle->getNamespace(); // default title "settings" (RT #145371), don't touch special pages if ($ns == NS_FORUM) { $this->title = $wgTitle->getText(); $this->displaytitle = false; // we don't want htmlspecialchars for SpecialPages (BugId:6012) } else if ($ns == NS_SPECIAL) { $this->displaytitle = true; } else if ($ns != NS_SPECIAL) { $this->displaytitle = true; $this->title = $wgOut->getPageTitle(); } // remove namespaces prefix from title $namespaces = array(NS_MEDIAWIKI, NS_TEMPLATE, NS_CATEGORY, NS_FILE); if (defined('NS_VIDEO')) { $namespaces[] = NS_VIDEO; } if ( in_array($ns, array_merge( $namespaces, $wgSuppressNamespacePrefix ) ) ) { $this->title = $wgTitle->getText(); $this->displaytitle = false; } if (WikiaPageType::isMainPage()) { $this->title = ''; $this->subtitle = ''; } else if (BodyController::isHubPage()) { $this->title = wfMsg('hub-header', $wgTitle); } wfProfileOut( __METHOD__ ); }