/** * @param $requestedWidth * @param $requestedHeight * @param $originalWidth * @param $originalHeight * @param $expParams * @dataProvider testGetImageResizeParamsDataProvider */ public function testGetImageResizeParams($originalWidth, $originalHeight, $requestedWidth, $requestedHeight, $expParams) { /* @var $helper WikiaHomePageHelper */ $helper = new WikiaHomePageHelper(); $params = $helper->getImageServingParamsForResize($requestedWidth, $requestedHeight, $originalWidth, $originalHeight); $this->assertEquals($expParams, $params); }
public function index() { $this->interlang = WikiaPageType::isCorporatePage(); $this->response->addAsset('extensions/wikia/CorporateFooter/styles/CorporateFooter.scss'); $helper = new WikiaHomePageHelper(); $wikisIncludedInCorporateFooterDropdown = $helper->getWikisIncludedInCorporateFooterDropdown(); $this->selectedLang = $this->wg->ContLang->getCode(); $this->dropDownItems = $this->prepareDropdownItems($wikisIncludedInCorporateFooterDropdown, $this->selectedLang); if ($this->app->wg->EnableWAMPageExt) { $wamModel = new WAMPageModel(); $this->wamPageUrl = $wamModel->getWAMMainPageUrl(); } }
/** * @desc Changes city_flags field in city_visualization table * * @param string $type one of: 'block', 'unblock', 'promote', 'remove-promote' * @requestParam integer $wikiId id of wiki that flags we want to change * @requestParam integer $corpWikiId id of wiki which "hosts" visualization * @requestParam string $lang language code of wiki which "hosts" visualization */ protected function changeFlag($type) { $this->wf->ProfileIn(__METHOD__); $wikiId = $this->request->getInt('wikiId', 0); $corpWikiId = $this->request->getInt('corpWikiId', 0); $langCode = $this->request->getVal('lang', 'en'); switch ($type) { case self::FLAG_TYPE_BLOCK: $result = $this->helper->setFlag($wikiId, WikisModel::FLAG_BLOCKED, $corpWikiId, $langCode); break; case self::FLAG_TYPE_UNBLOCK: $result = $this->helper->removeFlag($wikiId, WikisModel::FLAG_BLOCKED, $corpWikiId, $langCode); break; case self::FLAG_TYPE_PROMOTE: $result = $this->helper->setFlag($wikiId, WikisModel::FLAG_PROMOTED, $corpWikiId, $langCode); break; case self::FLAG_TYPE_DEMOTE: $result = $this->helper->removeFlag($wikiId, WikisModel::FLAG_PROMOTED, $corpWikiId, $langCode); break; default: $result = false; break; } $this->wf->ProfileOut(__METHOD__); return $result; }
public function getWikiBatchesForVisualization() { $numberOfBatches = $this->request->getVal('numberOfBatches', self::WIKI_BATCH_SIZE); $wikiId = $this->wg->cityId; $langCode = $this->wg->contLang->getCode(); $this->wikis = $this->helper->getWikiBatches($wikiId, $langCode, $numberOfBatches); }
/** * @desc Changes city_flags field in city_visualization table * * @requestParam string $type one of: self::CHANGE_FLAG_ADD or self::CHANGE_FLAG_REMOVE * @requestParam integer $flag from WikisModel which should be changed * @requestParam integer $wikiId id of wiki that flags we want to change * @requestParam integer $corpWikiId id of wiki which "hosts" visualization * @requestParam string $lang language code of wiki which "hosts" visualization * * @return bool */ public function changeFlag() { wfProfileIn(__METHOD__); if (!$this->checkAccess()) { $this->status = false; } else { $type = $this->request->getVal('type'); $flag = $this->request->getInt('flag'); $wikiId = $this->request->getInt('wikiId', 0); $corpWikiId = $this->request->getInt('corpWikiId', 0); $langCode = $this->request->getVal('lang', 'en'); if ($type == self::CHANGE_FLAG_ADD) { $this->status = $this->helper->setFlag($wikiId, $flag, $corpWikiId, $langCode); } else { $this->status = $this->helper->removeFlag($wikiId, $flag, $corpWikiId, $langCode); } } wfProfileOut(__METHOD__); }
public function getProcessedWikisImgSizesDataProvider() { $whh = new WikiaHomePageHelper(); return array(array(WikiaHomePageHelper::SLOTS_BIG_ARRAY_KEY, $whh->getRemixBigImgWidth(), $whh->getRemixBigImgHeight()), array(WikiaHomePageHelper::SLOTS_MEDIUM_ARRAY_KEY, $whh->getRemixMediumImgWidth(), $whh->getRemixMediumImgHeight()), array(WikiaHomePageHelper::SLOTS_SMALL_ARRAY_KEY, $whh->getRemixSmallImgWidth(), $whh->getRemixSmallImgHeight()), array(666, $whh->getRemixBigImgWidth(), $whh->getRemixBigImgHeight())); }
public function getImageUrl($imageFile, $requestedWidth, $requestedHeight) { return $this->homePageHelper->getImageUrlFromFile($imageFile, $requestedWidth, $requestedHeight); }
private function purgeWikiaHomepageHubs() { $lang = $this->wg->ContLang->getCode(); WikiaDataAccess::cachePurge(WikiaHomePageHelper::getHubSlotsMemcacheKey($lang)); $this->getHubsServicesHelper()->purgeHomePageVarnish($lang); }
<?php $seocounter = 0; /* @var $homePageHelper WikiaHomePageHelper */ $homePageHelper = new WikiaHomePageHelper(); ?> <div id="WikiPreviewInterstitialMask" class="WikiPreviewInterstitialMask hidden"> <section class="WikiPreviewInterstitial" class="hidden"> <div class="content-area"> <!-- Content area hook for javascript and css --> </div> <img src="<?php echo F::app()->wg->StylePath; ?> /oasis/images/icon_close.png" class="close-button wikia-chiclet-button" alt="Close"> </section> </div> <div id="visualization"> <div class="grid-6 alpha"> <div class="grid-1 alpha remix"> <h2><?php echo wfMsg('wikiahome-visualisation-remix-mixitup'); ?> </h2> <h3><?php echo wfMsg('wikiahome-visualisation-remix-mixituptext'); ?> </h3> <a href="#" class="wikia-button secondary remix-button <?php echo empty($collectionsList) ? 'chevron-not-visible' : ''; ?>