public static function getLiftiumOptionsScript()
 {
     wfProfileIn(__METHOD__);
     global $wgDBname, $wgTitle, $wgLang, $wgDartCustomKeyValues, $wgCityId;
     // See Liftium.js for documentation on options
     $options = array();
     $options['pubid'] = 999;
     $options['baseUrl'] = '/__varnish_liftium/';
     $options['kv_wgDBname'] = $wgDBname;
     if (is_object($wgTitle)) {
         $options['kv_article_id'] = $wgTitle->getArticleID();
         $options['kv_wpage'] = $wgTitle->getPartialURL();
     }
     $hub = WikiFactoryHub::getInstance();
     $options['kv_Hub'] = $hub->getCategoryName($wgCityId);
     $options['kv_skin'] = RequestContext::getMain()->getSkin()->getSkinName();
     $options['kv_user_lang'] = $wgLang->getCode();
     $options['kv_cont_lang'] = $GLOBALS['wgLanguageCode'];
     $options['kv_isMainPage'] = WikiaPageType::isMainPage();
     $options['kv_page_type'] = WikiaPageType::getPageType();
     $options['geoUrl'] = "http://geoiplookup.wikia.com/";
     if (!empty($wgDartCustomKeyValues)) {
         $options['kv_dart'] = $wgDartCustomKeyValues;
     }
     $options['kv_domain'] = $_SERVER['HTTP_HOST'];
     $options['hasMoreCalls'] = true;
     $options['isCalledAfterOnload'] = true;
     $options['maxLoadDelay'] = 6000;
     $js = "LiftiumOptions = " . json_encode($options) . ";\n";
     $out = "\n<!-- Liftium options -->\n";
     $out .= Html::inlineScript($js) . "\n";
     wfProfileOut(__METHOD__);
     return $out;
 }
Пример #2
0
 public static function onSkinAfterBottomScripts($skin, &$text)
 {
     if (WikiaPageType::isMainPage()) {
         $scripts = AssetsManager::getInstance()->getURL('njord_js');
         foreach ($scripts as $script) {
             $text .= Html::linkedScript($script);
         }
     }
     return true;
 }
 /**
  * Get page type for the current page (ad-wise).
  * Take into account type of the page and user status.
  * Return one of the PAGE_TYPE_* constants
  *
  * @return string
  */
 public function getPageType()
 {
     $title = null;
     if (WikiaPageType::isActionPage() || $this->wg->Request->getBool('noexternals', $this->wg->NoExternals) || $this->wg->Request->getBool('noads', false) || $this->wg->ShowAds === false || $this->wg->EnableAdEngineExt === false || !$this->app->checkSkin(['oasis', 'wikiamobile', 'venus'])) {
         $pageLevel = self::PAGE_TYPE_NO_ADS;
         return $pageLevel;
     }
     $runAds = WikiaPageType::isFilePage() || WikiaPageType::isForum() || WikiaPageType::isSearch() || WikiaPageType::isWikiaHub();
     if (!$runAds) {
         if ($this->wg->Title) {
             $title = $this->wg->Title;
             $namespace = $title->getNamespace();
             $runAds = in_array($namespace, $this->wg->ContentNamespaces) || isset($this->wg->ExtraNamespaces[$namespace]) || BodyController::isBlogListing() || BodyController::isBlogPost() || defined('NS_WIKIA_PLAYQUIZ') && $title->inNamespace(NS_WIKIA_PLAYQUIZ) || defined('NS_CATEGORY') && $namespace == NS_CATEGORY || defined('NS_PROJECT') && $namespace == NS_PROJECT || $title->isSpecial('Leaderboard') || $title->isSpecial('Maps') || $title->isSpecial('Newimages') || $title->isSpecial('Videos');
         }
     }
     if (!$runAds) {
         $pageLevel = self::PAGE_TYPE_NO_ADS;
         return $pageLevel;
     }
     $user = $this->wg->User;
     if (!$user->isLoggedIn() || $user->getGlobalPreference('showAds')) {
         // Only leaderboard, medrec and invisible on corporate sites for anonymous users
         if (WikiaPageType::isCorporatePage()) {
             $pageLevel = self::PAGE_TYPE_CORPORATE;
             return $pageLevel;
         }
         if (WikiaPageType::isSearch()) {
             $pageLevel = self::PAGE_TYPE_SEARCH;
             return $pageLevel;
         }
         if ($title && $title->isSpecial('Maps')) {
             $pageLevel = self::PAGE_TYPE_MAPS;
             return $pageLevel;
         }
         // All ads everywhere else
         $pageLevel = self::PAGE_TYPE_ALL_ADS;
         return $pageLevel;
     }
     // Logged in users get some ads on the main pages (except on the corporate sites)
     if (!WikiaPageType::isCorporatePage() && WikiaPageType::isMainPage()) {
         $pageLevel = self::PAGE_TYPE_HOMEPAGE_LOGGED;
         return $pageLevel;
     }
     // Override ad level for a (set of) specific page(s)
     // Use case: sponsor ads on a landing page targeted to Wikia editors (=logged in)
     if ($title && !empty($this->wg->PagesWithNoAdsForLoggedInUsersOverriden) && in_array($title->getDBkey(), $this->wg->PagesWithNoAdsForLoggedInUsersOverriden)) {
         $pageLevel = self::PAGE_TYPE_CORPORATE;
         return $pageLevel;
     }
     // And no other ads
     $pageLevel = self::PAGE_TYPE_NO_ADS;
     return $pageLevel;
 }
Пример #4
0
 public function getSetupHtml()
 {
     static $called = false;
     if ($called) {
         return false;
     }
     $called = true;
     global $wgDBname, $wgLang, $wgTitle, $wgAthenaDevHosts;
     if (!empty($_GET['athena_dev_hosts']) || !empty($wgAthenaDevHosts)) {
         $base = "http://athena.dev.wikia-inc.com/";
         $version = mt_rand();
         $out = "<script type=\"text/javascript\">var athena_dev_hosts = 1;</script>";
     } else {
         $base = "/__varnish_athena/";
         $version = "1";
         $out = '';
     }
     $out .= '<script type="text/javascript" src="' . $base . 'athena/Athena.js?' . $version . '"></script>' . "\n";
     if (!empty($_GET['athena_dev_hosts'])) {
     }
     // Page vars are variables that you want available in javascript for serving ads
     $pageVars = array();
     $pageVars['wgDBname'] = $wgDBname;
     $pageVars['hostname'] = getenv('HTTP_HOST');
     $pageVars['request'] = getenv('SCRIPT_URL');
     if (is_object($wgTitle)) {
         $pageVars['article_id'] = $wgTitle->getArticleID();
     }
     $pageVars['isMainPage'] = WikiaPageType::isMainPage();
     $cat = AdEngine::getCachedCategory();
     $pageVars['hub'] = $cat['name'];
     $pageVars['skin'] = RequestContext::getMain()->getSkin()->getSkinName();
     $pageVars['user_lang'] = $wgLang->getCode();
     $pageVars['cont_lang'] = $GLOBALS['wgLanguageCode'];
     $out .= '<script type="text/javascript">' . "\n";
     foreach ($pageVars as $name => $value) {
         // Type juggling
         if ($value === true) {
             $value = "true";
             // As a string
         } else {
             if ($value === false) {
                 $value = "";
             }
         }
         $out .= 'Athena.setPageVar("' . addslashes($name) . '", "' . addslashes($value) . '");' . "\n";
     }
     $out .= 'Athena.setPageVar( "browser", Athena.getBrowser() );' . "\n";
     // Pull the configs
     $out .= 'Athena.pullConfig();';
     $out .= '</script>';
     return $out;
 }
Пример #5
0
 public function executeTop()
 {
     if (WikiaPageType::isWikiaHub()) {
         $leaderboardName = 'HUB_TOP_LEADERBOARD';
     } elseif ($this->wg->EnableWikiaHomePageExt) {
         $leaderboardName = 'CORP_TOP_LEADERBOARD';
     } elseif (WikiaPageType::isMainPage()) {
         $leaderboardName = 'HOME_TOP_LEADERBOARD';
     } else {
         $leaderboardName = 'TOP_LEADERBOARD';
     }
     $this->leaderboardName = $leaderboardName;
 }
Пример #6
0
function wfWikiAnswersActionDropdown(&$moduleObject, &$params)
{
    global $wgTitle;
    $answerObj = Answer::newFromTitle($wgTitle);
    if (WikiaPageType::isMainPage()) {
        $moduleObject->action = null;
    } elseif ($answerObj->isQuestion() && !$answerObj->isArticleAnswered()) {
        if (isset($moduleObject->dropdown['move'])) {
            $moduleObject->action = $moduleObject->dropdown['move'];
            $moduleObject->actionName = 'move';
            unset($moduleObject->dropdown['move']);
        }
    }
    return true;
}
	public function executeIndex() {
		global $wgOut, $wgTitle, $wgSitename, $wgUser, $wgEnableBlog, $wgEnableCorporatePageExt, $wgEnableInfoBoxTest, $wgEnableWikiAnswers, $wgRequest, $wgMaximizeArticleAreaArticleIds;

		$this->isMainPage = WikiaPageType::isMainPage();

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

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

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

		$this->headerModuleName = 'CampfireHeader';

	}
 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;
     }
 }
Пример #9
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__);
 }
Пример #10
0
	function getTopAdCode(){
	        echo AdEngine::getInstance()->getSetupHtml();

		global $wgOut, $wgEnableIframeAds, $wgEnableTandemAds, $wgEnableFAST_HOME2;
		$topAdCode = '';
		if ($wgOut->isArticle()){
			if (WikiaPageType::isMainPage()){
				$topAdCode .= AdEngine::getInstance()->getPlaceHolderIframe('HOME_TOP_LEADERBOARD');
				if ($wgEnableFAST_HOME2) {
					$topAdCode .= AdEngine::getInstance()->getPlaceHolderIframe('HOME_TOP_RIGHT_BOXAD');
				}
			} else if ( WikiaPageType::isContentPage()){
				$topAdCode = AdEngine::getInstance()->getPlaceHolderIframe('TOP_LEADERBOARD');
			}
		} elseif (WikiaPageType::isSearch()) {
			$topAdCode .= AdEngine::getInstance()->getPlaceHolderIframe('TOP_LEADERBOARD');
			$topAdCode .= AdEngine::getInstance()->getPlaceHolderIframe('TOP_RIGHT_BOXAD');
		}
		return $topAdCode;
	}
 public static function onWikiaMobileAssetsPackages(array &$jsStaticPackages, array &$jsExtensionPackages, array &$scssPackages)
 {
     //this hook is fired only by the WikiaMobile skin, no need to check for what skin is being used
     if (F::app()->wg->EnableWikiaHomePageExt && WikiaPageType::isMainPage()) {
         $scssPackages[] = 'wikiahomepage_scss_wikiamobile';
     }
     return true;
 }
Пример #12
0
 protected function __construct()
 {
     $this->isMainPage = WikiaPageType::isMainPage();
 }
Пример #13
0
<?php

global $wgTitle;
global $wgGoogleAdClient;
if ($wgTitle->isContentPage() && !WikiaPageType::isMainPage()) {
    $AnswersGoogleHint = '';
    foreach ($wgTitle->getParentCategories() as $key => $val) {
        $AnswersGoogleHint .= substr($key, strpos($key, ':') + 1) . ',';
    }
    ?>
<div id="answers_footer">


<script type="text/javascript"><!--

google_ad_width = 728;google_ad_height = 90;
//google_ad_width = 300;google_ad_height =250;
//google_ad_width = 120;google_ad_height =600;
//google_ad_width = 160;google_ad_height =600;

google_ad_type = "text";
//google_ad_type = "text_image";

google_ad_region = "region";
google_ad_channel  = "7000000004";
google_hints       = "<?php 
    echo $AnswersGoogleHint;
    ?>
";
//google_page_url    = "";
//google_ui_features = "rc:6";
Пример #14
0
    function execute()
    {
        wfProfileIn(__METHOD__);
        global $wgContLang, $wgAllInOne, $wgArticle, $wgUser, $wgLogo, $wgStylePath, $wgStyleVersion, $wgRequest, $wgTitle, $wgSitename, $wgEnableFAST_HOME2, $wgExtensionsPath, $wgAllInOne, $wgContentNamespaces, $wgEnableRecipesTweaksExt, $wgBlankImgUrl;
        $skin = $wgUser->getSkin();
        $namespace = $wgTitle->getNamespace();
        ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="<?php 
        $this->text('xhtmldefaultnamespace');
        ?>
" <?php 
        foreach ($this->data['xhtmlnamespaces'] as $tag => $ns) {
            ?>
xmlns:<?php 
            echo "{$tag}=\"{$ns}\" ";
        }
        ?>
xml:lang="<?php 
        $this->text('lang');
        ?>
" lang="<?php 
        $this->text('lang');
        ?>
" dir="<?php 
        $this->text('dir');
        ?>
">
<?php 
        wfProfileIn(__METHOD__ . '-head');
        ?>
	<head>
		<meta http-equiv="Content-Type" content="<?php 
        $this->text('mimetype');
        ?>
; charset=<?php 
        $this->text('charset');
        ?>
" />
                <!-- Skin = <?php 
        echo basename(__FILE__);
        ?>
 -->
		<?php 
        $this->html('headlinks');
        ?>

		<title><?php 
        $this->text('pagetitle');
        ?>
</title>
		<?php 
        print Skin::makeGlobalVariablesScript($this->data);
        $allinone = $wgAllInOne;
        // Getting the extension CSS in a similar way to Oasis (whole skin should ideally be ported to Oasis soon).
        // Remove the media="print CSS from the normal array and add it to another so that it can be loaded asynchronously at the bottom of the page.
        global $wgOut;
        $printStyles = array();
        $tmpOut = new OutputPage();
        $tmpOut->styles = $wgOut->styles;
        foreach ($tmpOut->styles as $style => $options) {
            if (isset($options['media']) && $options['media'] == 'print') {
                unset($tmpOut->styles[$style]);
                $printStyles[$style] = $options;
            }
        }
        // render CSS <link> tags
        $csslinks = $tmpOut->buildCssLinks();
        // Extension css
        print $csslinks;
        // Site-CSS.
        global $wgUser, $wgStylePath, $wgJsMimeType;
        $srcs = [$wgStylePath . "/lyricsminimal/article.css"];
        // Probably ghetto.  This whole skin needs to just be rewritten as Oasis modifications anyway though.
        foreach ($srcs as $src) {
            echo '<link rel="stylesheet" href="' . htmlspecialchars($src) . '">';
        }
        // Javascript (Oasis Style).
        $jsFiles = '';
        $srcs = AssetsManager::getInstance()->getGroupCommonURL('oasis_shared_js');
        $srcs = array_merge($srcs, AssetsManager::getInstance()->getGroupCommonURL('oasis_extensions_js'));
        $srcs = array_merge($srcs, AssetsManager::getInstance()->getGroupLocalURL($wgUser->isLoggedIn() ? 'oasis_user_js' : 'oasis_anon_js'));
        foreach ($srcs as $src) {
            $jsFiles .= "<script type=\"{$wgJsMimeType}\" src=\"{$src}\"></script>";
        }
        print $jsFiles;
        if ($wgRequest->getVal('action') != '' || $namespace == NS_SPECIAL) {
            $this->html('WikiaScriptLoader');
            $this->html('JSloader');
            $this->html('headscripts');
        }
        $this->printAdditionalHead();
        ?>
	</head>
<?php 
        wfProfileOut(__METHOD__ . '-head');
        ?>

<?php 
        wfProfileIn(__METHOD__ . '-body');
        if (WikiaPageType::isMainPage()) {
            $isMainpage = ' mainpage';
        } else {
            $isMainpage = null;
        }
        $action = $wgRequest->getVal('action');
        if (in_array($action, array('edit', 'history', 'diff', 'delete', 'protect', 'unprotect', 'submit'))) {
            $body_css_action = 'action_' . $action;
        } else {
            if (empty($action) || in_array($action, array('view', 'purge'))) {
                $body_css_action = 'action_view';
            } else {
                $body_css_action = '';
            }
        }
        if (!isset($this->extraBodyClasses)) {
            // For extra classes to put on the body tag.  This allows overriding sub-skins to create selectors specific to their sub-skin (such as custom answers).
            $this->extraBodyClasses = array();
        }
        ?>
	<body<?php 
        if ($this->data['body_onload']) {
            ?>
 onload="<?php 
            $this->text('body_onload');
            ?>
"<?php 
        }
        ?>
 class="mediawiki <?php 
        $this->text('dir');
        ?>
 <?php 
        $this->text('pageclass');
        if (!empty($this->data['printable'])) {
            ?>
 printable<?php 
        }
        if (!$wgUser->isLoggedIn()) {
            ?>
 loggedout<?php 
        }
        ?>
 color2 wikiaSkinMonaco wikiaSkinLyricsMinimal<?php 
        echo $isMainpage;
        ?>
 <?php 
        echo $body_css_action;
        print " " . implode($this->extraBodyClasses, " ");
        ?>
" id="body">

<?php 
        // this hook allows adding extra HTML just after <body> opening tag
        // append your content to $html variable instead of echoing
        $html = '';
        wfRunHooks('GetHTMLAfterBody', array($this, &$html));
        echo $html;
        // NOTE: Removed wikia_header and user links.
        ?>
		<!-- PAGE -->
<?php 
        wfProfileIn(__METHOD__ . '-page');
        ?>

	<div class="monaco_shrinkwrap" id="monaco_shrinkwrap_main">
<?php 
        wfRunHooks('MonacoBeforeWikiaPage', array($this));
        ?>
		<div id="wikia_page">
<?php 
        if (empty($wgEnableRecipesTweaksExt) || !RecipesTweaks::isHeaderStripeShown()) {
            ?>
		<div class='lyricsMinimalTop clearfix'>
			<div id="wiki_logo" style="background-image: url(<?php 
            echo $wgLogo;
            ?>
);"><a href="<?php 
            echo htmlspecialchars($this->data['nav_urls']['mainpage']['href']);
            ?>
" accesskey="z"><?php 
            echo $wgSitename;
            ?>
</a></div>

			<!-- // TODO: Place REAL leaderboard ad here. -->
			<!-- <div id="lyricsMinimalTop_leader"><img src="http://www.iab.net/media/image/728X90.gif"/></div> -->

		</div>
			<?php 
            // NOTE: Removed page-bar page_bar here.
            ?>
					<!-- ARTICLE -->

<?php 
        }
        wfProfileIn(__METHOD__ . '-article');
        ?>
			<div id="article" <?php 
        if ($this->data['body_ondblclick']) {
            ?>
ondblclick="<?php 
            $this->text('body_ondblclick');
            ?>
"<?php 
        }
        ?>
>
				<a name="top" id="top"></a>
				<?php 
        wfRunHooks('MonacoAfterArticle', array($this));
        // recipes: not needed?
        global $wgSupressSiteNotice, $wgEnableCommunityMessagesExt;
        if (empty($wgEnableCommunityMessagesExt) && empty($wgSupressSiteNotice) && $this->data['sitenotice']) {
            ?>
<div id="siteNotice"><?php 
            $this->html('sitenotice');
            ?>
</div><?php 
        }
        ?>
				<?php 
        global $wgSupressPageTitle;
        if (empty($wgSupressPageTitle)) {
            $this->printFirstHeading();
        }
        if ($wgRequest->getVal('action') == 'edit') {
            //echo '<br /><a href="#" id="editTipsLink" onclick="editTips(); return false;">Show Editing Tips</a>';
        }
        ?>
				<div id="bodyContent">
					<h3 id="siteSub"><?php 
        $this->msg('tagline');
        ?>
</h3>
					<div id="contentSub"><?php 
        $this->html('subtitle');
        ?>
</div>
					<?php 
        if ($this->data['undelete']) {
            ?>
<div id="contentSub2"><?php 
            $this->html('undelete');
            ?>
</div><?php 
        }
        ?>
					<?php 
        if ($this->data['newtalk']) {
            ?>
<div class="usermessage noprint"><?php 
            $this->html('newtalk');
            ?>
</div><?php 
        }
        ?>
					<?php 
        if (!empty($skin->newuemsg)) {
            echo $skin->newuemsg;
        }
        ?>
					<?php 
        echo $this->getTopAdCode();
        ?>

					<!-- start content -->
					<?php 
        // Display content
        $this->printContent();
        $this->printCategories();
        ?>
					<!-- end content -->
					<?php 
        if ($this->data['dataAfterContent']) {
            $this->html('dataAfterContent');
        }
        ?>
					<div class="visualClear"></div>
				</div>

				<!--google_ad_section_end-->
				<!--contextual_targeting_end-->

			</div>
			<!-- /ARTICLE -->
			<?php 
        // NOTE: Removed article footer.
        wfProfileOut(__METHOD__ . '-article');
        ?>
		</div>
		<!-- /PAGE -->

<?php 
        wfProfileOut(__METHOD__ . '-page');
        ?>

		<noscript><link rel="stylesheet" type="text/css" href="<?php 
        echo $wgStylePath;
        ?>
/monaco/css/noscript.css?<?php 
        echo $wgStyleVersion;
        ?>
" /></noscript>
<?php 
        if (!($wgRequest->getVal('action') != '' || $namespace == NS_SPECIAL)) {
            $this->html('WikiaScriptLoader');
            $this->html('JSloader');
            $this->html('headscripts');
        }
        echo '<script type="text/javascript">/*<![CDATA[*/Wikia.LazyQueue.makeQueue(wgAfterContentAndJS, function(fn) {fn();}); wgAfterContentAndJS.start(); /*]]>*/</script>' . "\n";
        // NOTE: Removed wikia_footer.
        // NOTE: Removed WIDGETS (sidebar stuff) here.
        // curse like cobranding
        $this->printCustomFooter();
        ?>

<?php 
        echo '</div>';
        // Quant serve moved *after* the ads because it depends on Athena/Provider values.
        // macbre: RT #25697 - hide Quantcast Tags on edit pages
        if (in_array($wgRequest->getVal('action'), array('edit', 'submit'))) {
            echo '<!-- QuantServe and comscore hidden on edit page -->';
        } else {
            echo AnalyticsEngine::track('Comscore', AnalyticsEngine::EVENT_PAGEVIEW);
            echo AnalyticsEngine::track('QuantServe', AnalyticsEngine::EVENT_PAGEVIEW);
            echo AnalyticsEngine::track('Exelate', AnalyticsEngine::EVENT_PAGEVIEW);
        }
        $this->html('bottomscripts');
        /* JS call to runBodyOnloadHook */
        wfRunHooks('SpecialFooter');
        ?>
		<div id="positioned_elements" class="reset"></div>
<?php 
        $this->html('reporttime');
        wfProfileOut(__METHOD__ . '-body');
        ?>

	</body>
</html>
<?php 
        wfProfileOut(__METHOD__);
    }
Пример #15
0
	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;
			}
		}
	}
Пример #16
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__);
	}
Пример #17
0
    public static function getLiftiumOptionsScript()
    {
        wfProfileIn(__METHOD__);
        global $wgDBname, $wgTitle, $wgLang;
        // See Liftium.js for documentation on options
        $options = array();
        $options['pubid'] = 999;
        $options['baseUrl'] = '/__varnish_liftium/';
        $options['kv_wgDBname'] = $wgDBname;
        if (is_object($wgTitle)) {
            $options['kv_article_id'] = $wgTitle->getArticleID();
            $options['kv_wpage'] = $wgTitle->getPartialURL();
        }
        $cat = AdEngine::getCachedCategory();
        $options['kv_Hub'] = $cat['name'];
        $options['kv_skin'] = RequestContext::getMain()->getSkin()->getSkinName();
        $options['kv_user_lang'] = $wgLang->getCode();
        $options['kv_cont_lang'] = $GLOBALS['wgLanguageCode'];
        $options['kv_isMainPage'] = WikiaPageType::isMainPage();
        $options['kv_page_type'] = WikiaPageType::getPageType();
        $options['geoUrl'] = "http://geoiplookup.wikia.com/";
        if (!empty($wgDartCustomKeyValues)) {
            $options['kv_dart'] = $wgDartCustomKeyValues;
        }
        $options['kv_domain'] = $_SERVER['HTTP_HOST'];
        $js = "LiftiumOptions = " . json_encode($options) . ";\n";
        if (WikiaPageType::isSearch() || !$wgTitle->getNamespace() == NS_SPECIAL && !BodyController::isEditPage()) {
            $js .= <<<EOT
\t\t\t\tif ( !window.wgLoadAdDriverOnLiftiumInit && ( !window.Wikia.AbTest || !Wikia.AbTest.inTreatmentGroup( "AD_LOAD_TIMING", "ONLOAD" ) ) ) {
\t\t\t\t\tLiftiumOptions['hasMoreCalls'] = true;
\t\t\t\t\tLiftiumOptions['isCalledAfterOnload'] = true;
\t\t\t\t\tLiftiumOptions['maxLoadDelay'] = 6000;
\t\t\t\t}
\t\t\t\telse {
\t\t\t\t\tLiftiumOptions['autoInit'] = false;
\t\t\t\t}
EOT;
        } else {
            $js .= <<<EOT
\t\t\t\tLiftiumOptions['hasMoreCalls'] = true;
\t\t\t\tLiftiumOptions['isCalledAfterOnload'] = true;
\t\t\t\tLiftiumOptions['maxLoadDelay'] = 6000;
EOT;
        }
        $js = AssetsManagerBaseBuilder::minifyJs($js);
        $out = "\n<!-- Liftium options -->\n";
        $out .= Html::inlineScript($js) . "\n";
        wfProfileOut(__METHOD__);
        return $out;
    }
Пример #18
0
echo $body_ondblclick ? ' ondblclick="' . htmlspecialchars($body_ondblclick) . '"' : '';
?>
>
					<?php 
if ($displayAdminDashboardChromedArticle) {
    ?>
						<?php 
    echo (string) $app->sendRequest('AdminDashboardSpecialPage', 'chromedArticleHeader', array('headerText' => $wg->Title->getText()));
    ?>
					<?php 
}
?>

					<div class="home-top-right-ads">
					<?php 
if (!WikiaPageType::isCorporatePage() && !$wg->EnableVideoPageToolExt && WikiaPageType::isMainPage()) {
    echo $app->renderView('Ad', 'Index', ['slotName' => 'HOME_TOP_RIGHT_BOXAD', 'pageTypes' => ['homepage_logged', 'corporate', 'all_ads']]);
}
?>
					</div>
					<?php 
if ($runNjord) {
    echo $app->renderView('Njord', 'Summary');
    echo $app->renderView($headerModuleName, $headerModuleAction, $headerModuleParams);
}
?>
					<?php 
// for InfoBox-Testing
if ($wg->EnableInfoBoxTest) {
    echo $app->renderView('ArticleInfoBox', 'Index');
}
Пример #19
0
 /**
  * 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 (in_array($ns, array_merge($namespaces, $wgSuppressNamespacePrefix))) {
         $this->title = $wgTitle->getText();
         $this->displaytitle = false;
     }
     if (WikiaPageType::isMainPage()) {
         $this->title = '';
         $this->subtitle = '';
     }
     wfProfileOut(__METHOD__);
 }
Пример #20
0
<?php
			}
?>

				</ul>
<?php
		}
?>
			</li>
<?php
	}
}
?>
		</ul>
	</nav>
	<div class="buttons">
<?php if ($wg->EnableCorporatePageExt) {
		if (WikiaPageType::isMainPage()) echo F::app()->renderView('Search', 'Index');
		echo F::app()->renderView('RandomWiki', 'Index');
} else { ?>
		<?= Wikia::specialPageLink('Random', 'oasis-button-random-page', array('accesskey' => 'x', 'class' => 'wikia-button secondary', 'data-id' => 'randompage', 'title' => wfMsg('oasis-button-random-page-tooltip')), 'blank.gif', null, 'sprite random') ?>
		<?= Wikia::specialPageLink('WikiActivity', 'oasis-button-wiki-activity', array('accesskey' => 'g', 'class' => 'wikia-button secondary', 'data-id' => 'wikiactivity', 'title' => wfMsg('oasis-button-wiki-activity-tooltip')), 'blank.gif', null, 'sprite activity') ?>
<?php } ?>
	</div>
	<div style="position: absolute; top: -1000px">
		<?= Wikia::specialPageLink('Watchlist', 'watchlist', array('accesskey' => 'l')) ?>
		<?= Wikia::specialPageLink('RecentChanges', 'recentchanges', array('accesskey' => 'r')) ?>
	</div>
	<?= $displaySearch ? F::app()->renderView('Search', 'Index') : '' ?>
</header>
Пример #21
0
<?php

if (!empty($wg->EnableMonetizationModuleExt)) {
    if (!empty($wg->AdDriverUseMonetizationService)) {
        echo $app->renderView('Ad', 'Index', ['slotName' => 'MON_ABOVE_TITLE']);
    } else {
        if (!empty($monetizationModules[MonetizationModuleHelper::SLOT_TYPE_ABOVE_TITLE])) {
            echo $monetizationModules[MonetizationModuleHelper::SLOT_TYPE_ABOVE_TITLE];
        }
    }
}
$runNjord = !empty($wg->EnableNjordExt) && WikiaPageType::isMainPage();
if ($runNjord) {
    // edit button with actions dropdown
    if (!empty($action)) {
        echo F::app()->renderView('MenuButton', 'Index', array('action' => $action, 'image' => $actionImage, 'dropdown' => $dropdown, 'name' => $actionName));
    }
} else {
    ?>
	<!-- @TODO CONCF-189 everything inside this if should be removed when social buttons are live -->
	<?php 
    if (empty($wg->EnablePageShareExt)) {
        ?>
		<header id="WikiaPageHeader" class="WikiaPageHeader">
			<h1><?php 
        echo !empty($displaytitle) ? $title : htmlspecialchars($title);
        ?>
</h1>

			<?php 
        // edit button with actions dropdown
Пример #22
0
 public function getSetupHtml($params = null)
 {
     static $called = false;
     if ($called) {
         return false;
     }
     $called = true;
     wfProfileIn(__METHOD__);
     global $wgDBname, $wgLang, $wgTitle, $wgLiftiumDevHosts, $wgDevelEnvironment;
     global $wgDartCustomKeyValues, $wgLoadAdDriverOnLiftiumInit;
     // See Liftium.js for documentation on options
     $options = array();
     $options['pubid'] = 999;
     $options['baseUrl'] = '/__varnish_liftium/';
     $options['kv_wgDBname'] = $wgDBname;
     if (is_object($wgTitle)) {
         $options['kv_article_id'] = $wgTitle->getArticleID();
         $options['kv_wpage'] = $wgTitle->getPartialURL();
     }
     $cat = AdEngine::getCachedCategory();
     $options['kv_Hub'] = $cat['name'];
     $options['kv_skin'] = RequestContext::getMain()->getSkin()->getSkinName();
     $options['kv_user_lang'] = $wgLang->getCode();
     $options['kv_cont_lang'] = $GLOBALS['wgLanguageCode'];
     $options['kv_isMainPage'] = WikiaPageType::isMainPage();
     $options['kv_page_type'] = WikiaPageType::getPageType();
     $options['geoUrl'] = "http://geoiplookup.wikia.com/";
     if (!empty($wgDartCustomKeyValues)) {
         $options['kv_dart'] = $wgDartCustomKeyValues;
     }
     $options['kv_domain'] = $_SERVER['HTTP_HOST'];
     if (!empty($params)) {
         if (isset($params['isCalledAfterOnload'])) {
             $options['isCalledAfterOnload'] = $params['isCalledAfterOnload'];
         }
         if (isset($params['hasMoreCalls'])) {
             $options['hasMoreCalls'] = $params['hasMoreCalls'];
         }
         if (isset($params['maxLoadDelay'])) {
             $options['maxLoadDelay'] = $params['maxLoadDelay'];
         }
     }
     // LiftiumOptions as json
     $out = '<script type="text/javascript">' . "\n";
     $out .= "LiftiumOptions = " . json_encode($options) . ";\n";
     $out .= '</script>';
     // Call the script
     global $wgDevelEnvironment;
     if (!empty($_GET['liftium_dev_hosts']) || !empty($wgLiftiumDevHosts)) {
         $base = "http://nick.dev.liftium.com/";
         $version = '?' . mt_rand();
         $out .= "<script type=\"text/javascript\">var liftium_dev_hosts = 1;</script>";
     } else {
         if ($wgDevelEnvironment) {
             $base = "http://liftium.wikia.com/";
             $version = '?' . mt_rand();
         } else {
             $base = "/__varnish_liftium/";
             $version = "";
         }
     }
     if ($options['kv_skin'] != 'oasis') {
         foreach (AssetsManager::getInstance()->getGroupCommonURL('liftium_ads_js') as $src) {
             $out .= '<script type="text/javascript" src="' . htmlspecialchars($src) . '"></script>' . "\n";
         }
     }
     wfProfileOut(__METHOD__);
     return $out;
 }