/** * @param string $facetAttribute attribute field from FacetField class * @return string[] list of taxonomies */ static function getForcedCheckedTaxonomy( $facetAttribute ) { if (SolrSafeOperatorHelper::featureIsActive('FacetTaxonomy')) { $forcedCheckedFeatureValues = SolrSafeOperatorHelper::feature('FacetTaxonomy','ForcedCheckedFacetTaxonomy'); if ( isset($forcedCheckedFeatureValues[$facetAttribute]) ) { return explode(';', $forcedCheckedFeatureValues[$facetAttribute][0]); } } return array(); }
public function __construct($params, $outputType, $blockName, $applicationName, $applicationObject, $applicationLocalized) { $ini = eZINI::instance( 'merck.ini' ); if ( SolrSafeOperatorHelper::featureIsActive( 'ContactForm' ) ) { $this->senderEmail = SolrSafeOperatorHelper::feature( 'ContactForm', 'fromEmail'); } else { $this->senderEmail = $ini->variable( self::FULLTEXT_SETTING_BLOCK_NAME, 'FromEmail' ); } parent::__construct( $params, $outputType, $blockName, $applicationName, $applicationObject, $applicationLocalized ); }
public function __construct() { $ini = eZINI::instance( 'merck.ini' ); if( $ini->hasVariable( 'ActiveMQ', 'BrokerUrl' ) ) { $this->messageBrokerUrl = $ini->variable( 'ActiveMQ', 'BrokerUrl' ); } else { $this->messageBrokerUrl = SolrSafeOperatorHelper::feature( 'AsynchronousAnalyticsLoginCall', 'BrokerUrl' ); } $this->queuePrefix = SolrSafeOperatorHelper::feature( 'AsynchronousAnalyticsLoginCall', 'QueuePrefix' ); }
/** * @param string $attribute * @return array */ public static function getMapping($attribute) { $solrField = "attr_{$attribute}_dt"; $overrideFacetPublischedIsActive = SolrSafeOperatorHelper::featureIsActive('PublishedDateFacetCustom'); if ($overrideFacetPublischedIsActive) { $appIdentifier = SolrSafeOperatorHelper::feature('PublishedDateFacetCustom', 'ApplicationIdentifier'); if($appIdentifier[0] == self::$applicationIdentifier) { return array( array( 'label' => 'date-3', 'query' => "$solrField:[NOW-3DAYS/DAY TO *]" ), array( 'label' => 'date-7', 'query' => "$solrField:[NOW-7DAYS/DAY TO *]" ), array( 'label' => 'all', 'query' => "$solrField:[NOW-15DAYS/DAY TO *]" ), ); } } else { return array( array( 'label' => 'date-7', 'query' => "$solrField:[NOW-7DAYS/DAY TO *]" ), array( 'label' => 'date-30', 'query' => "$solrField:[NOW-30DAYS/DAY TO *]" ), array( 'label' => 'date-90', 'query' => "$solrField:[NOW-90DAYS/DAY TO *]" ), array( 'label' => 'date-365', 'query' => "$solrField:[NOW-1YEAR/DAY TO *]" ), ); } }
/** * @param array $postData * @throws Exception * @throws ezcLogWriterException */ private static function configCurlClient($postData) { if( SolrSafeOperatorHelper::featureIsActive( 'OverrideWSHandler' ) ) { $hostUrl = SolrSafeOperatorHelper::feature('OverrideWSHandler', 'Url'); self::instance()->logger->log("BaseUrl :" .$hostUrl, ezcLog::INFO); curl_setopt_array(self::instance()->client(), array( CURLOPT_URL => $hostUrl, CURLOPT_POST => TRUE, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_RETURNTRANSFER => TRUE, CURLOPT_HTTPHEADER => array( // $hostUrl, 'Content-Type: application/json', 'AuthKey: dcec0748-e4a4-40da-bcee-b2f9f794af55' ), CURLOPT_POSTFIELDS => json_encode(self::mapESBDataToWS($postData)) )); } }
/** * @param int $uxType * @param string $key * @param string $field */ public function __construct($uxType, $key, $field) { parent::__construct($uxType, $key, $field); $this->canBeHidden = true; $this->hideEmptyValues = false; if ( self::isForcedLanguage() ) { $this->forcedValues = array( LocaleTool::languageISO639Code(LocaleTool::mainLanguage()) ); } $defaultValues = array( LocaleTool::languageISO639Code() ); foreach( LocaleTool::languageList() as $locale ) { $language = LocaleTool::languageISO639Code( $locale ); if( !isset($defaultValues[$language]) ) $defaultValues[] = $language; } $this->defaultValues = $defaultValues; $overrideLanguageFacetIsActive = SolrSafeOperatorHelper::featureIsActive('DefaultLanguageFacetValues'); if ($overrideLanguageFacetIsActive) { $forcedLanguageOverrides = SolrSafeOperatorHelper::feature('DefaultLanguageFacetValues', 'ApplicationDefaultLanguage'); if (!empty($forcedLanguageOverrides)) { $identifier = self::$applicationIdentifier; if (!empty($identifier) && isset($forcedLanguageOverrides[$identifier])) { $this->forcedValues = $forcedLanguageOverrides[$identifier]; } } } }
protected static function getMappingFormToConsent() { $mappingFormToConsent = array( parent::SUBSCRIPTION_UNI_MEDICAL_UPDATES => array( 1 => implode(';', array(parent::SUBSCRIPTION_STATUS_SUBSCRIBED, parent::SUBSCRIPTION_FREQUENCY_DAILY)), 2 => implode(';', array(parent::SUBSCRIPTION_STATUS_SUBSCRIBED, parent::SUBSCRIPTION_FREQUENCY_WEEKLY)), 4 => parent::SUBSCRIPTION_STATUS_UNSUBSCRIBED, ), parent::SUBSCRIPTION_UNI_ONCOLOGY => array( 1 => implode(';', array(parent::SUBSCRIPTION_STATUS_SUBSCRIBED, parent::SUBSCRIPTION_FREQUENCY_DAILY)), 2 => implode(';', array(parent::SUBSCRIPTION_STATUS_SUBSCRIBED, parent::SUBSCRIPTION_FREQUENCY_WEEKLY)), 4 => parent::SUBSCRIPTION_STATUS_UNSUBSCRIBED, ), parent::SUBSCRIPTION_UNI_MEDICAL_EDUCATION => array( 1 => implode(';', array(parent::SUBSCRIPTION_STATUS_SUBSCRIBED, parent::SUBSCRIPTION_FREQUENCY_WEEKLY)), 2 => implode(';', array(parent::SUBSCRIPTION_STATUS_SUBSCRIBED, parent::SUBSCRIPTION_FREQUENCY_MONTHLY)), 3 => parent::SUBSCRIPTION_STATUS_UNSUBSCRIBED, ), parent::SUBSCRIPTION_UNI_ANNOUNCEMENT => array( 1 => parent::SUBSCRIPTION_STATUS_SUBSCRIBED, 2 => parent::SUBSCRIPTION_STATUS_UNSUBSCRIBED, ), parent::SUBSCRIPTION_MSD_PRODUCT_INFORMATION => array( 1 => parent::SUBSCRIPTION_STATUS_SUBSCRIBED, 2 => parent::SUBSCRIPTION_STATUS_UNSUBSCRIBED, ), parent::SUBSCRIPTION_MSD_CLINICAL_FOCUS => array( 1 => parent::SUBSCRIPTION_STATUS_SUBSCRIBED, 2 => parent::SUBSCRIPTION_STATUS_UNSUBSCRIBED, ), parent::SUBSCRIPTION_MSD_CORPORATE_NEWS => array( 1 => parent::SUBSCRIPTION_STATUS_SUBSCRIBED, 2 => parent::SUBSCRIPTION_STATUS_UNSUBSCRIBED, ), parent::SUBSCRIPTION_PHONE_CONSENT => array( 1 => parent::SUBSCRIPTION_STATUS_SUBSCRIBED, 2 => parent::SUBSCRIPTION_STATUS_UNSUBSCRIBED, ), 'termsOfUse_v' . (string)SolrSafeOperatorHelper::feature( 'ToUPPPopin', 'currentToUConsentVersion' ) => array( 1 => parent::SUBSCRIPTION_STATUS_SUBSCRIBED, 2 => parent::SUBSCRIPTION_STATUS_UNSUBSCRIBED, ), 'privacyPolicy_v' . (string)SolrSafeOperatorHelper::feature( 'ToUPPPopin', 'currentPPConsentVersion' ) => array( 1 => parent::SUBSCRIPTION_STATUS_SUBSCRIBED, 2 => parent::SUBSCRIPTION_STATUS_UNSUBSCRIBED, ), parent::SUBSCRIPTION_OPTIN_PROMO_EMAIL . '_v' . (string)SolrSafeOperatorHelper::feature( 'ToUPPPopin', 'currentOptInPromoEmailVersion' ) => array( 1 => parent::SUBSCRIPTION_STATUS_SUBSCRIBED, 2 => parent::SUBSCRIPTION_STATUS_UNSUBSCRIBED, ), parent::SUBSCRIPTION_OPTIN_PROMO_WEBSITE . '_v' . (string)SolrSafeOperatorHelper::feature( 'ToUPPPopin', 'currentOptInPromoWebsiteVersion' ) => array( 1 => parent::SUBSCRIPTION_STATUS_SUBSCRIBED, 2 => parent::SUBSCRIPTION_STATUS_UNSUBSCRIBED, ), parent::SUBSCRIPTION_OPTIN_EXT_PARTNERS . '_v' . (string)SolrSafeOperatorHelper::feature( 'ToUPPPopin', 'currentOptInExtPartnersVersion' ) => array( 1 => parent::SUBSCRIPTION_STATUS_SUBSCRIBED, 2 => parent::SUBSCRIPTION_STATUS_UNSUBSCRIBED, ), ); return $mappingFormToConsent; }
'parameters' => array( 'LogOnID' => array( 'type' => 'string', 'required' => 'true', 'location' => 'postField' ), 'CountryCode' => array( 'type' => 'string', 'required' => 'true', 'location' => 'postField' ) ) ), 'GenerateCertificateURL' => array( 'extends' => 'abstract', 'uri' => SolrSafeOperatorHelper::feature('MyCertificates', 'MyCertificatesPrefix') . '/GenerateCertificateURL', 'summary' => 'Returns a generated certificate url', 'parameters' => array( 'UserID' => array( 'type' => 'string', 'required' => 'true', 'location' => 'postField' ), 'CourseID' => array( 'type' => 'string', 'required' => 'true', 'location' => 'postField' ), 'CountryID' => array( 'type' => 'string', 'required' => 'true',
/** * @param bool $forceExternal * @return string */ public function applicationUrl( $forceExternal = false ) { $skipPage = (bool) $this->getCustomParameter( 'SkipExitPage' ) && ( is_object( MMUsers::getCurrentUserObject() ) ); // Direct redirect without exit page if( $this->getCustomParameter( 'DirectLinkOpen' ) == 1 ) { return $this->attribute( 'external_url' ); } $baseUrl = eZINI::instance()->variable( 'SiteAccessSettings', 'BaseUrl' ); $urlAlias = $this->attribute( 'url' ); if( !$urlAlias ) $urlAlias = $this->applicationObject()->attribute( 'url' ); // external if ( $forceExternal || ( $this->applicationObject->applicationType()->attribute('internal_type') == ApplicationObject::APPLICATION_TYPE_EXTERNAL ) ) { // Production //if(SolrSafeOperatorHelper::clusterIni("SocialSharing", "EntryExit", "merck.ini") == "enabled") if(SolrSafeOperatorHelper::featureIsActive("SocialSharing") && SolrSafeOperatorHelper::feature("SocialSharing", "EntryExit") && !$skipPage) return $baseUrl. $this->attribute( 'url' ); else return $baseUrl.'external/' . $this->attribute( 'url' ); /* Dev * return $baseUrl.'esibuild/main_view/app_content/' . $this->attribute( 'url' ); */ } return $baseUrl . $urlAlias; }
if ( !isset( $Params['mode'] ) || !isset( $Params['action'] ) ) { return $module->handleError( eZError::KERNEL_NOT_AVAILABLE ); } $mode = SolrSafeOperatorHelper::feature('CookieLaw', 'Mode'); if ( !$mode ) { $mode = 'passive'; } $action = $Params['action']; $cookieKey = "cookie_{$mode}_optin_cookie"; $lifeTime = SolrSafeOperatorHelper::feature( 'CookieLaw' , 'Lifetime' ); $lifeTime = ( $lifeTime ? $lifeTime : 61516800 ); $cookieVersion = SolrSafeOperatorHelper::feature( 'CookieLaw' , 'Version' ); $cookieVersion = ( $cookieVersion ? $cookieVersion : 1 ); switch ( $action ) { case 'accept': setcookie( $cookieKey, $cookieVersion, time() + $lifeTime, '/', CookieTool::getCookieDomain() ); break; } header('Content-type: application/json'); echo json_encode( array( 'ErrorCode' => 0 ) ); eZExecution::cleanExit();
public function htmlBuildResult() { $lessFiles = SolrSafeOperatorHelper::getLessFiles( ($this->app) ? $this->app->applicationObject()->attribute('identifier') : $this->applicationName(), $this->app ); $this->tpl()->setVariable( 'applicationLessFiles', $lessFiles ); if ( !$this->app ) return; if ( $this->app->isFull ) { if ( $this->app->node && $this->app->node instanceof eZContentObjectTreeNode ) { $dataMap = $this->app->node->dataMap(); if($dataMap["serialized_taxonomies"]){ $taxonomies = $dataMap["serialized_taxonomies"]->content(); $publisherPath = $taxonomies["publisher_folder"][0]; $publisherFolder = $this->app->applicationLocalized()->getPublisherFolderFromPath($publisherPath); if (isset($taxonomies['language']) && $publisherFolder instanceof PublisherFolder) { $publisherLanguages = $publisherFolder->getLanguages(); $languageList = $taxonomies['language']; //$languageTranslations = FacetFilteringTool::getTaxonomyTranslation('language'); $availableLanguages = array(); foreach (array_keys($this->app->node->object()->allLanguages()) as $locale) { if (is_array($publisherLanguages) && in_array($locale, $publisherLanguages)) { $key = LocaleTool::languageISO639Code($locale); $availableLanguages[$key] = $locale; } } } $uri = eZURI::instance(); $uriParams = $uri->UserParameters(); if(isset($uriParams['language'])) $uriLang = $uriParams['language']; if ($uriLang) { $this->app->node->setCurrentLanguage($uriLang); } if (in_array($publisherLanguages[0], $availableLanguages)){ if ($this->app->node->currentLanguage() != $publisherLanguages[0]) { $this->app->node->setCurrentLanguage($publisherLanguages[0]); } } } } if ( SolrSafeOperatorHelper::featureIsActive( "SocialSharing" ) && SolrSafeOperatorHelper::feature( "SocialSharing", "EntryExit" ) ) { $this->pushResult( "socialInfos", $this->app->getSocialInfos() ); } if ( $this->app->node instanceof eZContentObjectTreeNode ) $this->pushResult( "current_node", $this->app->node ); } else if ( $this->app->isSeo ) { $goToSpeciality = null; if ( is_null( $this->app->seoParams["speciality"] ) && $this->app->seoParams["noSpeciality"] ) { $goToSpeciality = "all/speciality"; } $this->pushResult( "seoMetas", $this->app->getSeoMetas() ); $this->pushResult( "doSpecialityRedirect", $goToSpeciality ); } }
$isConsentOptOut = in_array( ClusterTool::clusterIdentifier(), array() ); $displayToUPPAndOptInsBlockTitle = in_array( ClusterTool::clusterIdentifier(), array( 'cluster_france' ) ); $visitorCountry = SolrSafeOperatorHelper::getLocaleBySystemCode( 'ga_visitor_country' ); if( $visitorCountry == 'not provided' || !isset($visitorCountry) || is_null($visitorCountry) || empty($visitorCountry)){ $dt = new DateTime("Europe/Warsaw"); $msg = 'Missing ga_visitor_country for '.ClusterTool::clusterIdentifier().' at '.$dt->format('Y-m-d H:i:s'); ezLog::write($msg, 'toupp_visitor_country.log'); } echo json_encode( array( 'userProfile' => $userProfile, 'displayConsents' => $displayConsents, 'useDedicatedPage' => (ContextTool::instance()->isMobile() ? SolrSafeOperatorHelper::feature( 'ToUPPPopin', 'useDedicatedPageMobile' ) : SolrSafeOperatorHelper::feature( 'ToUPPPopin', 'useDedicatedPage' )), 'visitorCountry' => SolrSafeOperatorHelper::getLocaleBySystemCode( 'ga_visitor_country' ), 'staticPages' => array( 'ToU' => is_null( $touPage ) ? null : $touPage->attribute( 'core_content' ), 'PP' => is_null( $ppPage ) ? null : $ppPage->attribute( 'core_content' ) ), 'features' => array( 'currentToUConsentVersion' => $currentToUConsentVersion, 'currentPPConsentVersion' => $currentPPConsentVersion, 'hasCheckbox' => $hasCheckbox, 'precheckedCheckbox' => $precheckedCheckbox, 'adaptConsentText' => $adaptConsentText, 'isConsentOptOut' => $isConsentOptOut, 'displayToUPPAndOptInsBlockTitle' => $displayToUPPAndOptInsBlockTitle, 'touPPCheckboxFeatures' => $touPPCheckboxFeatures, 'optInFeatures' => $optInFeatures,
/** * @return bool */ public function jsonBuildResult() { $this->initChannelInformations(); $editorsChoice = $this->getEditorsChoice(); $this->resultHandler->parseRequestParams(true); $solrResult = $this->resultHandler->contentResultMain(); if ($this->getCustomParameter('IncludeChildrenInSearch')) { $this->resultHandler->getChildArticles($solrResult); } $facets = array(); $this->pushResult('num_found', (int)$solrResult['response']['numFound']); $this->pushResult('with_feed', $this->resultHandler->withFeed); if ( $this->resultHandler->withFacets ) { foreach ( $this->facets as $facet) { /* @var $facet FacetBase */ $f = array( 'uxtype' => $facet->uxtype, 'list' => ( $facet->isFiltered() ) ? $this->resultHandler->filteredFacetResult( $facet ) : $facet->facetResult( $solrResult ) ); // JsonBuildResult is called again with facet with no result unchecked (state change via $this->facets) if ( $facet->needsRefresh ) return $this->jsonBuildResult(); $facets[$facet->key] = $f; } $this->pushResult('facets', $facets); } if (!empty($editorsChoice)) { $editorsChoice = $this->resultHandler->articleResult($editorsChoice, $facets); $this->pushResult('editors_choice' , $this->getEditorsChoiceView($editorsChoice)); } $solrReturn = $this->resultHandler->articleResult($solrResult, $facets); $this->pushResult('articles', $this->setVariableAndGetTpl($solrReturn)); if ( isset($solrReturn['all_specialities_informations'] ) ) { $allSpecialitiesInformations = $solrReturn['all_specialities_informations']; unset( $solrReturn['all_specialities_informations'] ); if (SolrSafeOperatorHelper::featureIsActive('SpecialityPopin') && SolrSafeOperatorHelper::feature('SpecialityPopin', 'CustomGroupsEnabled')) { $flatSpecialitiesList = array(); foreach($allSpecialitiesInformations['all_specialities'] as $value) { foreach($value as $name => $data) { $name = StringTool::trim($name); $flatSpecialitiesList[$name] = $data; } } $customGroups = SolrSafeOperatorHelper::feature('SpecialityPopin', 'Groups'); $allSpecialities = array(); foreach ($customGroups as $name => $specialities) { $name = StringTool::trim($name); $allSpecialities[$name] = array(); foreach($specialities as $speciality) { $speciality = StringTool::trim($speciality); if (isset($flatSpecialitiesList[$speciality])) { $allSpecialities[$name][$speciality] = $flatSpecialitiesList[$speciality]; unset($flatSpecialitiesList[$speciality]); } } } $allSpecialitiesInformations['all_specialities'] = $allSpecialities; } foreach ($allSpecialitiesInformations as $templateVariable => $templateValue) $this->tpl()->setVariable($templateVariable, $templateValue); $this->pushResult('all_specialities', $this->tpl()->fetch('design:'.$this->templateRootDirectory().'/content_service/specialities_list.tpl')); } $t3Facet = array(); if ( isset($solrReturn['t3_facet_informations'] ) ) { if ( count($solrReturn['t3_facet_informations']) > 0 ) { $t3FacetInformations = $solrReturn['t3_facet_informations']; foreach ($t3FacetInformations as $templateVariable => $templateValue) $this->tpl()->setVariable($templateVariable, $templateValue); $t3Facet[$t3FacetInformations['t3_key']] = $this->tpl()->fetch('design:'.$this->templateRootDirectory().'/content_service/t3_facet_list.tpl'); } unset( $solrReturn['t3_facet_informations'] ); } $this->pushResult('t3_facets', $t3Facet); foreach ( $solrReturn as $resultVariable => $resultValue ) $this->pushResult($resultVariable, $resultValue); return true; }
/** * @return array */ protected function getOptInSubscriptions() { $subsFields = $this->getSubscriptionsFields(); $consentArray = array(); if ( SolrSafeOperatorHelper::feature( 'ToUPPPopin', 'currentOptInPromoEmailVersion' ) != false ) { $consentArray[] = array( $subsFields['emailOffId'] => self::SUBSCRIPTION_OPTIN_PROMO_EMAIL . '_v' . (string)SolrSafeOperatorHelper::feature('ToUPPPopin', 'currentOptInPromoEmailVersion'), $subsFields['status'] => isset($_POST[self::SUBSCRIPTION_OPTIN_PROMO_EMAIL]) ? ($_POST[self::SUBSCRIPTION_OPTIN_PROMO_EMAIL] == 1 ? self::SUBSCRIPTION_STATUS_SUBSCRIBED : self::SUBSCRIPTION_STATUS_UNSUBSCRIBED) : self::SUBSCRIPTION_STATUS_SUBSCRIBED ); } if ( SolrSafeOperatorHelper::feature( 'ToUPPPopin', 'currentOptInPromoWebsiteVersion' ) != false ) { $consentArray[] = array( $subsFields['emailOffId'] => self::SUBSCRIPTION_OPTIN_PROMO_WEBSITE . '_v' . (string)SolrSafeOperatorHelper::feature('ToUPPPopin', 'currentOptInPromoWebsiteVersion'), $subsFields['status'] => isset($_POST[self::SUBSCRIPTION_OPTIN_PROMO_WEBSITE]) ? ($_POST[self::SUBSCRIPTION_OPTIN_PROMO_WEBSITE] == 1 ? self::SUBSCRIPTION_STATUS_SUBSCRIBED : self::SUBSCRIPTION_STATUS_UNSUBSCRIBED) : self::SUBSCRIPTION_STATUS_SUBSCRIBED ); } if ( SolrSafeOperatorHelper::feature( 'ToUPPPopin', 'currentOptInExtPartnersVersion' ) != false ) { $consentArray[] = array( $subsFields['emailOffId'] => self::SUBSCRIPTION_OPTIN_EXT_PARTNERS . '_v' . (string)SolrSafeOperatorHelper::feature('ToUPPPopin', 'currentOptInExtPartnersVersion'), $subsFields['status'] => isset($_POST[self::SUBSCRIPTION_OPTIN_EXT_PARTNERS]) ? ($_POST[self::SUBSCRIPTION_OPTIN_EXT_PARTNERS] == 1 ? self::SUBSCRIPTION_STATUS_SUBSCRIBED : self::SUBSCRIPTION_STATUS_UNSUBSCRIBED) : self::SUBSCRIPTION_STATUS_SUBSCRIBED ); } return $consentArray; }
/** * @return eZTemplate */ public function tpl() { if(is_null($this->_tpl)) { eZTemplate::resetInstance(); $this->_tpl = eZTemplate::factory(); if (SolrSafeOperatorHelper::featureIsActive('showMedicalNewsDemo') && SolrSafeOperatorHelper::feature('ShowMedicalNewsDemo', 'showDemo')){ $showMedicalNewsDemo = true; }else { $showMedicalNewsDemo = false; } $this->_tpl->setVariable('showMedicalNewsDemo',$showMedicalNewsDemo); $this->_tpl->setVariable('language' , LocaleTool::languageISO639Code()); $this->_tpl->setVariable('application_class' , get_class($this) ); $this->_tpl->setVariable('view_parameters' , $this->_params['UserParameters']); $this->_tpl->setVariable('cluster_identifier', ClusterTool::clusterIdentifier()); $this->_tpl->setVariable('application_url' , $this->applicationName()); $this->_tpl->setVariable('consult' , $this->isConsult); $this->_tpl->setVariable('httpcontext' , array( 'host' => ContextTool::instance()->domain(), )); $environment = new MMEnvironment(); $this->_tpl->setVariable('environment' , $environment->env); $applicationLocalized = CacheApplicationTool::buildLocalizedApplication($this->applicationName()); if (empty($applicationLocalized)) $this->_tpl->setVariable('application_name' , $this->applicationName()); else { $applicationIdentifier = $applicationLocalized->applicationObject->attribute('identifier'); $this->_tpl->setVariable('application_name' , $applicationIdentifier ); $this->_tpl->setVariable('current_localized' , $applicationLocalized ); $this->_tpl->setVariable('current_application' , $applicationLocalized->applicationObject ); } } return $this->_tpl; }
/** * @return string */ public static function getOldestFetchDate() { return SolrSafeOperatorHelper::feature( 'MyLearningTracker', 'OldestFetchDate' ); }
/** * @return array */ static function getParams() { return array( 'endPoint' => SolrSafeOperatorHelper::feature( 'ExactTarget', 'EndPoint' ), 'wsdl' => SolrSafeOperatorHelper::feature( 'ExactTarget', 'Wsdl' ), 'username' => SolrSafeOperatorHelper::feature( 'ExactTarget', 'Username' ), 'password' => SolrSafeOperatorHelper::feature( 'ExactTarget', 'Password' ), 'clientId' => SolrSafeOperatorHelper::feature( 'ExactTarget', 'ClientId' ), ); }
/** * @return bool */ protected function isLocalQuiz() { $isLocalQuiz = false; if (SolrSafeOperatorHelper::featureIsActive('QuizSettings')) { $localRankingApplications = SolrSafeOperatorHelper::feature('QuizSettings', 'LocalRankingApplications'); $isLocalQuiz = in_array($this->applicationObject->attribute('identifier'), $localRankingApplications); } return $isLocalQuiz; }
} if( $value ) setcookie( substr($value, -2) . '_Login', $value, 0, '/', CookieTool::getCookieDomain() ); } $userId = MMUsers::getCurrentUserId(); if ( !MMUsers::isAnonymous($userId) ) { if ( SolrSafeOperatorHelper::featureIsActive( 'ToUPPPopin' ) ) { if ( ( !ContextTool::instance()->isMobile() && SolrSafeOperatorHelper::feature( 'ToUPPPopin', 'useDedicatedPage' ) ) || ( ContextTool::instance()->isMobile() && SolrSafeOperatorHelper::feature('ToUPPPopin','showOnMobile') && SolrSafeOperatorHelper::feature('ToUPPPopin','useDedicatedPageMobile') ) ) { $serviceLogin = ESBFactory::getLoginService( ServiceLoginBase::ESB_METHOD_AUTOLOGIN, $_REQUEST ); if ( $serviceLogin->checkTouPPPopin( ESBFactory::getUserService()->form() ) ) { CookieTool::destroyCookie( 'displayToUPPPopin' ); CookieTool::destroyCookie( 'displayToUPPPopin', '/', null ); $serviceLogin->login(); eZExecution::cleanExit(); } } } // User is already logged-in, we redirect him $context = isset( $_REQUEST['context'] ) ? $_REQUEST['context'] : false;
<?php /** * The CRON will parse all clusters and check if feature is active * Make a CURL on the URL * If the content is valid and has at least 1 entry -> erase all children of the NodeID * Create a child for each entries with the HTML provided by UltraNoir and with info provided by the RSS */ if(SolrSafeOperatorHelper::featureIsActive('CongressReportRss')) { define('URL', SolrSafeOperatorHelper::feature('CongressReportRss', 'Url')); //define('nodeID', SolrSafeOperatorHelper::feature('CongressReportRss', 'NodeId')); } else { $cli = eZCLI::instance(); $cli->output( 'Feature "CongressReportRss" not found' ); } /** * get XML content of URL setted by feature * @return string XML */ function getXML() { try { //init curl session $curl = curl_init();
/** * @return bool */ public static function isCatchUpAppNameEnabled() { $isFeatureActive = SolrSafeOperatorHelper::featureIsActive( 'GlobalSearch' ); $isFeatureEnabled = SolrSafeOperatorHelper::feature( 'GlobalSearch', 'CatchAppNameEnabled' ); return $isFeatureActive && $isFeatureEnabled; }
/** * Checks if send to coleague * * @return boolean */ public static function isSendToColleagueDisabled() { if ( SolrSafeOperatorHelper::featureIsActive( 'DisableSendToColleague' ) ) return SolrSafeOperatorHelper::feature( 'DisableSendToColleague', 'IsDisabled' ); return false; }
<?php /** * The CRON will parse all clusters and check if feature is active * Make a CURL on the URL * If the content is valid and has at least 1 entry -> erase all children of the NodeID * Create a child for each entries with the HTML provided by UltraNoir and with info provided by the RSS */ $xmlUrl = ''; if(SolrSafeOperatorHelper::featureIsActive('CongressReportRss')) { $xmlUrl = SolrSafeOperatorHelper::feature('CongressReportRss', 'Url'); } else { $cli = eZCLI::instance(); $cli->output( 'Feature "CongressReportRss" not found' ); } $congressReportRss = new CongressReportRss($xmlUrl); $congressReportRss->importXMLToDatabase();
/** * @param eZTemplate $tpl * @param string $operatorName * @param array $operatorParameters * @param string $rootNamespace * @param string $currentNamespace * @param mixed $operatorValue * @param array $namedParameters */ function modify($tpl, $operatorName, $operatorParameters, $rootNamespace, $currentNamespace, &$operatorValue, $namedParameters) { switch ($operatorName) { /*******************************************************************************/ /* Solr Safe Operators */ /*******************************************************************************/ case 'ezfind_raw_fetch': $operatorValue = SolrSafeOperatorHelper::ezfindRawFetch( $namedParameters['params'], $namedParameters['nodeIdsOnly'] ); break; case 'getUrlSolr': $operatorValue = SolrSafeOperatorHelper::getUrlSolr($namedParameters['solrdata']); break; case 'getDatesPDFavailable': $operatorValue = SolrSafeOperatorHelper::getDatesPDFavailable( $namedParameters['onlineDate'], $namedParameters['daysAvailable'] ); break; case 'getViewCounter': $operatorValue = SolrSafeOperatorHelper::getViewCounter( $namedParameters['remoteId'], $namedParameters['clusterIdentifier'] ); break; case 'getRatings': $operatorValue = SolrSafeOperatorHelper::getRatings( $namedParameters['remoteId'], $namedParameters['clusterIdentifier'] ); break; case 'getJavascriptFiles': $operatorValue = SolrSafeOperatorHelper::getJavascriptFiles( $namedParameters['application_name'], $namedParameters['type'], $namedParameters['isConsult'] ); break; case 'getLessFiles': $operatorValue = SolrSafeOperatorHelper::getLessFiles( $namedParameters['application_name'], $namedParameters['application'], $namedParameters['isConsult'] ); break; case 'getInfosApp': $operatorValue = SolrSafeOperatorHelper::getInfosApp($namedParameters['application_identifier']); break; case 'getHostNameFromURL': $operatorValue = SolrSafeOperatorHelper::getHostNameFromURL($namedParameters['url']); break; case 'context': $operatorValue = SolrSafeOperatorHelper::context($namedParameters['url']); break; case 'getMetas': $operatorValue = SolrSafeOperatorHelper::getMetas($namedParameters['applicationName']); break; case 'getSolrData': $operatorValue = SolrSafeOperatorHelper::getSolrData( $namedParameters['remoteId'], $namedParameters['clusterIdentifier'], $namedParameters['extended_fields'] ); break; case 'getCustomParameter': $operatorValue = SolrSafeOperatorHelper::getCustomParameter( $namedParameters['application'], $namedParameters['parameter_name'], $namedParameters['context'] ); break; case 'getAppIdentifierForIcon': $operatorValue = SolrSafeOperatorHelper::getAppIdentifierForIcon($namedParameters['application']); break; case 'getApplicationUrl': $operatorValue = SolrSafeOperatorHelper::getApplicationUrl($namedParameters['identifier']); break; case 'mappingNameSpe': $operatorValue = SolrSafeOperatorHelper::mappingNameSpe($namedParameters['specialtie']); break; case 'getMappingSpe': $operatorValue = SolrSafeOperatorHelper::getMappingSpe(); break; case 'getCustomerTypes': $operatorValue = SolrSafeOperatorHelper::getCustomerTypes(); break; case 'getMainSpecialities': $operatorValue = SolrSafeOperatorHelper::getMainSpecialities(); break; case 'getUserSpecialities': $operatorValue = SolrSafeOperatorHelper::getUserSpecialities(); break; case 'noSeoLink': $operatorValue = SolrSafeOperatorHelper::noSeoLink($operatorValue); break; case 'getTaxoTranslation': $operatorValue = SolrSafeOperatorHelper::getTaxoTranslation( $namedParameters['identifier'], $namedParameters['remote_id'] ); break; case 'cluster_ini': $operatorValue = SolrSafeOperatorHelper::clusterIni( $namedParameters['section'], $namedParameters['variable'], $namedParameters['ini_file'] ); break; case 'truncateContentRelated': $operatorValue = SolrSafeOperatorHelper::truncateContentRelated($namedParameters['text']); break; case 'myCertificatesEnabled': $operatorValue = SolrSafeOperatorHelper::featureIsActive("MyCertificates"); break; case 'appHasSpeciality': $operatorValue = SolrSafeOperatorHelper::appHasSpeciality(); break; case 'setClusterIdentifier': // No $operatorValue modification is normal SolrSafeOperatorHelper::setClusterIdentifier($namedParameters['clusterIdentifier']); break; case 'featureIsActive': $operatorValue = SolrSafeOperatorHelper::featureIsActive($namedParameters['featureCode']); break; case 'feature': $operatorValue = SolrSafeOperatorHelper::feature( $namedParameters['featureCode'], $namedParameters['value'] ); break; case 'alphabet': $operatorValue = SolrSafeOperatorHelper::alphabet(); break; case 'generateIso6391': $operatorValue = SolrSafeOperatorHelper::generateIso6391($namedParameters['regionalSettingsLocale']); break; case 'staticfile': $operatorValue = SolrSafeOperatorHelper::staticFile( $operatorValue, $namedParameters['quote'], $namedParameters['skip_slash'] ); break; case 'showHelpDeskPhoneInHeader': $operatorValue = !(SolrSafeOperatorHelper::feature('HelpDeskSettings', 'HidePhoneNumberInHeader')); break; case 'showHelpDeskPhoneOnPage': $operatorValue = !(SolrSafeOperatorHelper::feature('HelpDeskSettings', 'HidePhoneNumberOnPage')); break; case 'getFooterHTML': $operatorValue = SolrSafeOperatorHelper::getFooterHTML($namedParameters['footerBlockIdentifier']); break; case 'getLocaleBySystemCode': $operatorValue = SolrSafeOperatorHelper::getLocaleBySystemCode($namedParameters['systemCode']); break; case 'buildExitUrl': $operatorValue = SolrSafeOperatorHelper::buildExitUrl($namedParameters['url']); break; case 'getUserToken': $operatorValue = SolrSafeOperatorHelper::getUserToken(); break; case 'clusterHasFeaturedChannel': $operatorValue = SolrSafeOperatorHelper::clusterHasFeaturedChannel(); break; case 'aliasDimensions': $operatorValue = SolrSafeOperatorHelper::aliasDimensions($namedParameters['alias']); break; case 'hasImageArticleFromSolr': $operatorValue = SolrSafeOperatorHelper::hasImageArticleFromSolr( $namedParameters['solrdata'], $namedParameters['media_case'] ); break; case 'getImageArticleUrl': $operatorValue = SolrSafeOperatorHelper::getImageArticleUrl( $namedParameters['media_case'], $namedParameters['object_id'], $namedParameters['language'], $namedParameters['alias'] ); break; case 'getImageArticleUrlFromSolr': $operatorValue = SolrSafeOperatorHelper::getImageArticleUrl( $namedParameters['media_case'], $namedParameters['solrdata']['object_id'], $namedParameters['solrdata']['language'], $namedParameters['alias'] ); break; case 'isHidden': $operatorValue = SolrSafeOperatorHelper::isHidden($namedParameters['contentobject_id']); break; case 'isObjectGloballyVisible': $operatorValue = SolrSafeOperatorHelper::isObjectGloballyVisible($namedParameters['contentobject_id']); break; case 'getClusterVisibilities': $operatorValue = SolrSafeOperatorHelper::getClusterVisibilities($namedParameters['contentobject_id']); break; case 'parseTranslationTagParams': $operatorValue = SolrSafeOperatorHelper::parseTranslationTagParams($namedParameters['params']); break; case 'isSendToColleagueDisabled': $operatorValue = SolrSafeOperatorHelper::featureIsActive('DisableSendToColleague') ? SolrSafeOperatorHelper::feature('DisableSendToColleague', 'IsDisabled') : false; break; case 'getListOfValueOptions': $operatorValue = SolrSafeOperatorHelper::getListOfValueOptions( $namedParameters['business_name'], $namedParameters['filter'] ); break; case 'getListOfValues': $operatorValue = SolrSafeOperatorHelper::getListOfValues( $namedParameters['business_name'], $namedParameters['filter'] ); break; case 'solrDateToStamp': $operatorValue = strtotime($namedParameters['date']) > 3600*24*2 ? SolrTool::getTimestampFromSolr($namedParameters['date']) : 0; break; case 'getSeoParam': $operatorValue = SolrSafeOperatorHelper::getSeoParam($namedParameters['applicationLocalized'], $namedParameters['name'], $namedParameters['params']); break; case 'applicationHasSeoSpeciality': $operatorValue = SolrSafeOperatorHelper::applicationHasSeoSpeciality($namedParameters['applicationIdentifier']); break; case 'seoIsEnabled': $operatorValue = SolrSafeOperatorHelper::seoIsEnabled($namedParameters['applicationIdentifier']); break; case 'includeEsi': $operatorValue = SolrSafeOperatorHelper::includeEsi( $namedParameters['src'], $namedParameters['debug'] ); break; case 'imageDecHash': $operatorValue = SolrSafeOperatorHelper::imageDecHash( $operatorValue ); break; case 'bannerDecHash': $operatorValue = SolrSafeOperatorHelper::bannerDecHash( $operatorValue ); break; case 'getAndStoreGPNotebookHS': $operatorValue = self::getAndStoreGPNotebookHS( ); break; case 'isPromoTaxonomyVisible': $operatorValue = SolrSafeOperatorHelper::isPromoTaxonomyVisible( $namedParameters['values'] ); break; case 'translateTaxonomy': $operatorValue = SolrSafeOperatorHelper::translateTaxonomy( $namedParameters['code'] ); break; case 'getPublisherArticleUrl': $operatorValue = SolrSafeOperatorHelper::getPublisherArticleUrl( $namedParameters['publisher'], $namedParameters['articleId'] ); break; } }
public function htmlBuildResult() { $this->pushResult( 'is_mobile', ContextTool::instance()->isMobile() ); $this->pushResult( 'anonymousUrl', $this->anonymousUrl ); $this->pushResult( 'parisSynchHour', SolrSafeOperatorHelper::feature( 'merckConnectWebServices', 'parisSynchHour' ) ); }
/** * @return bool */ public static function checkCookieLaw() { if(!SolrSafeOperatorHelper::featureIsActive("CookieLaw")) { return true; } if (self::isCookieLawSupportedByUserPreferences()) { $cookieLawVersionKey = self::getCookieLawVersionKey(); $currentVersion = SolrSafeOperatorHelper::feature( 'CookieLaw' , 'Version' ); $userObject = self::getCurrentUserObject(); if ( !$userObject->hasPreference( $cookieLawVersionKey ) && isset( $_COOKIE[$cookieLawVersionKey] ) ) { $userObject->setPreference( $cookieLawVersionKey , $_COOKIE[$cookieLawVersionKey] ); } else if ( !isset( $_COOKIE[$cookieLawVersionKey] ) && $userObject->hasPreference( $cookieLawVersionKey ) ) { $lifeTime = SolrSafeOperatorHelper::feature( 'CookieLaw' , 'Lifetime' ); $lifeTime = ( $lifeTime ? $lifeTime : 33696000 ); setcookie( $cookieLawVersionKey, $userObject->getPreference( $cookieLawVersionKey ), time() + $lifeTime, '/', $_SERVER['HTTP_X_REQ_HOST'] ); } $cookieLawVersion = $userObject->getPreference( $cookieLawVersionKey ); if ( $currentVersion && $cookieLawVersion !== $currentVersion ) { setcookie( $cookieLawVersionKey, '', time() - 3600, '/', $_SERVER['HTTP_X_REQ_HOST'] ); return false; } } return true; }
/** * @param array $solrResult * @return array */ public function facetResult( &$solrResult ) { $translations = FacetFilteringTool::getTaxonomyTranslation ( $this->attribute ); $result = parent::facetResult($solrResult); //sorting $keysById = array(); foreach ( $result as $k => $f ) $keysById[$f['id']] = $k; $sortedResult = array(); foreach($this->defaultValues as $id) { if( isset($keysById[$id])) { $visible = true; if (SolrSafeOperatorHelper::featureIsActive('Univadis18Redesign')) { $hiddenValues = SolrSafeOperatorHelper::feature('Univadis18Redesign', 'SpecialtyFacetHiddenValues'); if (in_array($id, $hiddenValues)) { $visible = false; } } $f = $result[$keysById[$id]]; $f['visible'] = $visible; $sortedResult[$keysById[$id]] = $f; } else { if ( isset($translations[$id]) ) { $visible = true; if (SolrSafeOperatorHelper::featureIsActive('Univadis18Redesign')) { $hiddenValues = SolrSafeOperatorHelper::feature('Univadis18Redesign', 'SpecialtyFacetHiddenValues'); if (in_array($id, $hiddenValues)) { $visible = false; } } $sortedResult[$translations[$id]] = array( 'count' => 0, 'id' => $id, 'checked' => 0, 'visible' => $visible, ); } } } return $sortedResult; }
<?php $learningtrackerPrefix = SolrSafeOperatorHelper::feature('MyLearningTracker', 'LMTPrefix'); return array( 'name' => 'My learning tracker', 'apiVersion' => 0.1, 'baseUrl' => SolrSafeOperatorHelper::feature('MyLearningTracker', 'LMTBaseUrl'), 'description' => 'My certificates Webservice', 'operations' => array( 'abstract' => array( 'httpMethod' => 'POST' ), 'GetUserAllLearningTrackerCourses' => array( 'extends' => 'abstract', 'uri' => $learningtrackerPrefix . '/GetUserAllLearningTrackerCourses', 'summary' => 'Returns all learning tracker courses for a given user', 'parameters' => array( 'AuthenticationKey' => array( 'type' => 'string', 'required' => 'true', 'location' => 'postField' ), 'UserID' => array( 'type' => 'string', 'required' => 'true', 'location' => 'postField' ), 'CountryCode' => array( 'type' => 'string', 'required' => 'true',
/** * @return string */ protected function startCourseOverWsdl() { $courseId = ( isset( $_POST['courseid'] ) && filter_var($_POST['courseid'], FILTER_VALIDATE_REGEXP, SecurityTool::$ELEARNING_COURSEID_REGEXP) ) ? $_POST['courseid'] : null; $soapUrl = SolrSafeOperatorHelper::feature('OnlineVortrageSettings', 'WsdlUrl'); $credentialLogin = SolrSafeOperatorHelper::feature('OnlineVortrageSettings', 'WsdlLogin'); $credentialPassword = SolrSafeOperatorHelper::feature('OnlineVortrageSettings', 'WsdlPassword'); $useLocale = SolrSafeOperatorHelper::feature('OnlineVortrageSettings', 'UseLocale'); $locale = SolrSafeOperatorHelper::feature('OnlineVortrageSettings', 'Locale'); $credentials = array( 'login' => $credentialLogin, 'password' => $credentialPassword, ); $params = array( array( 'username' => MMUsers::getCurrentUserId(), 'courseID' => $courseId, ) ); if ( $useLocale ) { $params[0]['locale'] = $locale; } try { $soap = new SoapClientAuth( $soapUrl, $credentials ); $result = $soap->__soapCall( 'UnivadisEncrypt', $params ); if ( isset($result) && isset($result->return) ) { $url = $result->return; if ( strpos($url, 'http') !== 0 || strpos($url, 'https') !== 0) { $url = 'http://' . $url; } if ( !ContextTool::instance()->isMobile() ) { $url = urlencode( urlencode( $url ) ); $url = '/external/deeplink?deeplink=' . $url . '&exit_strategy=0'; } return $url; } } catch ( SoapFault $f ) { } return false; }
/** * @param string $templateParameterName * @param string $email * @param string $url * @return string * @throws Exception */ protected static function buildUrl($templateParameterName, $email, $url = '') { if (!SolrSafeOperatorHelper::featureIsActive('UUMP')) { throw new Exception('UUMP feature not activated'); } $protocol = SolrSafeOperatorHelper::feature('UUMP', 'MailServiceProtocol'); $host = SolrSafeOperatorHelper::feature('UUMP', 'MailServiceHost'); $templateId = SolrSafeOperatorHelper::feature('UUMP', $templateParameterName); $url = empty($url) ? '' : urlencode($url); return "{$protocol}://{$host}/helpdesk/sendemail?c={$templateId}&id={$email}" . (!empty($url) ? "&l={$url}" : ""); }