public function getColours()
 {
     $this->app->wf->profileIn(__METHOD__);
     $result = SassUtil::getOasisSettings();
     $colours['line'] = $result['color-buttons'];
     $colours['labels'] = $result['color-links'];
     $colours['body'] = $result['color-page'];
     $this->app->wf->profileOut(__METHOD__);
     return $colours;
 }
 private function setWikiColor()
 {
     $wiki_colors = SassUtil::getOasisSettings();
     if (strlen($wiki_colors["color-buttons"]) != 7) {
         // this resolves Futurama Wiki's problem
         $this->wikiColor = COLORINCASEOFERROR;
         $this->msg('-------------------------------------');
         $this->msg('Error in collecting Wiki\'s color! Color set to ' . COLORINCASEOFERROR . ', can be changed in EvolutionModel.class.php file.');
         $this->msg('-------------------------------------');
     } else {
         $wiki_color = substr($wiki_colors["color-buttons"], 1);
         $this->wikiColor = strtoupper($wiki_color);
     }
 }
Example #3
0
 public function getColorForLabels()
 {
     $result = SassUtil::getOasisSettings();
     return $result['color-links'];
 }
Example #4
0
 public function getStaticMapUrl()
 {
     $latLon = implode(',', $this->getLatLon());
     // use SASS button color for marker
     $colors = SassUtil::getOasisSettings();
     $markerColor = '0x' . ltrim($colors['color-buttons'], '#');
     $aParams = array('center' => $latLon, 'markers' => "color:{$markerColor}|{$latLon}", 'size' => $this->getWidth() . 'x' . $this->getHeight(), 'zoom' => $this->getZoom(), 'maptype' => 'roadmap', 'sensor' => 'false');
     $sParams = http_build_query($aParams);
     return 'http://maps.googleapis.com/maps/api/staticmap?' . $sParams;
 }
 /**
  * Set wiki theme setting to the ad units
  * @param array $adUnits
  * @param string $memcKey
  * @param boolean $setMemc - set to true to set data to memcache
  * @return array
  */
 public function setThemeSettings($adUnits, $memcKey, $setMemc = true)
 {
     wfProfileIn(__METHOD__);
     $adTitle = $this->wf->Message('monetization-module-ad-title')->escaped();
     $adUnits = str_replace(self::KEYWORD_AD_TITLE, $adTitle, $adUnits);
     $ecommTitle = $this->wf->Message('monetization-module-ecommerce-title')->escaped();
     $adUnits = str_replace(self::KEYWORD_ECOMMERCE_TITLE, $ecommTitle, $adUnits);
     $theme = SassUtil::getOasisSettings();
     if (SassUtil::isThemeDark()) {
         $theme['color'] = self::FONT_COLOR_DARK_THEME;
     } else {
         $theme['color'] = self::FONT_COLOR_LIGHT_THEME;
     }
     $adSettings = '';
     foreach (self::$mapThemeSettings as $key => $value) {
         if (!empty($theme[$value])) {
             $adSettings .= $key . '="' . $theme[$value] . '" ';
         }
     }
     $adUnits = str_replace(self::KEYWORD_THEME_SETTINGS, $adSettings, $adUnits);
     // set data to cache
     if ($setMemc) {
         $this->setMemcache($memcKey, $adUnits, ['method' => __METHOD__]);
     }
     wfProfileOut(__METHOD__);
     return $adUnits;
 }
Example #6
0
 /**
  * @desc Get Current wiki settings
  *
  * @return mixed
  */
 public function getWikiVariables()
 {
     global $wgSitename, $wgCacheBuster, $wgDBname, $wgDefaultSkin, $wgLang, $wgLanguageCode, $wgContLang, $wgCityId, $wgEnableNewAuth;
     return ['cacheBuster' => (int) $wgCacheBuster, 'dbName' => $wgDBname, 'defaultSkin' => $wgDefaultSkin, 'enableNewAuth' => $wgEnableNewAuth, 'id' => (int) $wgCityId, 'language' => ['user' => $wgLang->getCode(), 'userDir' => SassUtil::isRTL() ? 'rtl' : 'ltr', 'content' => $wgLanguageCode, 'contentDir' => $wgContLang->getDir()], 'mainPageTitle' => Title::newMainPage()->getPrefixedDBkey(), 'namespaces' => $wgContLang->getNamespaces(), 'siteMessage' => $this->getSiteMessage(), 'siteName' => $wgSitename, 'theme' => SassUtil::getOasisSettings(), 'wikiCategories' => WikiFactoryHub::getInstance()->getWikiCategoryNames($wgCityId)];
 }