Esempio n. 1
0
    public function replaceVariables(Pap_Common_BannerReplaceVariablesContext $context) {
        $seo_targeturl = Pap_Tracking_ClickTracker::getInstance()->getModRewriteClickUrl(
            $context->getBanner(), $context->getUser(), '',
            $context->getBanner()->getChannel(), $context->getBanner()->getDestinationUrl());

        $context->setText(Pap_Common_UserFields::replaceCustomConstantInText('seo_targeturl', $seo_targeturl, $context->getText()));
    }
Esempio n. 2
0
    private function getDisplayCodeFrom($data, Pap_Common_User $user, $flags = '') {
        $imageUrl = $this->get($data);
        $description = $this->getDescription($user);
        $format = self::FORMAT;

        $format = Pap_Common_UserFields::replaceCustomConstantInText('image_src', $imageUrl, $format);

        $format = $this->replaceUserConstants($format, $user);
        $format = $this->replaceUrlConstants($format, $user, $flags, '');

        return $format;
    }
Esempio n. 3
0
	protected function getBannerCode(Pap_Common_User $user, $flags, $data1 = '', $data2 = '') {
    	$title = $this->getTitle($user);
    	$description = $this->getDescription($user);
		$format = $this->getBannerFormat();
				
		$format = Pap_Common_UserFields::replaceCustomConstantInText('title', $title, $format);
		$format = Pap_Common_UserFields::replaceCustomConstantInText('description', $description, $format);
       	
		$format = $this->replaceUserConstants($format, $user);
    	$format = $this->replaceUrlConstants($format, $user, $flags, '', $data1, $data2);
    	$format = $this->replaceWidthHeightConstants($format, $flags);
    	
    	return $format;
	}
Esempio n. 4
0
    protected function getBannerCode(Pap_Common_User $user, $flags, $data1 = '', $data2 = '') {
        $imageUrl = $this->getImageUrl();
        $imageUrl = $this->changeActualDomainUrlHttpToHttps($imageUrl);
        $description = $this->getDescription($user);
        $format = $this->getBannerFormat();

        $format = Pap_Common_UserFields::replaceCustomConstantInText('image_src', $imageUrl, $format);
        $format = Pap_Common_UserFields::replaceCustomConstantInText('image_name', basename($imageUrl), $format);
        $format = Pap_Common_UserFields::replaceCustomConstantInText('alt', $description, $format);
        $format = Pap_Common_UserFields::replaceCustomConstantInText(Pap_Db_Table_Banners::SEOSTRING, $this->getSeoString(), $format);

        $format = $this->replaceUrlConstants($format, $user, $flags, '', $data1, $data2);
        $format = $this->replaceUserConstants($format, $user);
        $format = $this->replaceWidthHeightConstants($format, $flags);

        return $format;
    }
Esempio n. 5
0
	protected function getBannerCode(Pap_Common_User $user, $flags, $data1 = '', $data2 = '') {
		$flashUrl = $this->get('data1');
		$wmode = $this->get('data2');
		$loop = $this->get('data3');
			
		$format = $this->getBannerFormat();

		$format = Pap_Common_UserFields::replaceCustomConstantInText('flashurl', $flashUrl, $format);

		$wmode = ($wmode == '' ? "Opaque" : $wmode);
		$format = Pap_Common_UserFields::replaceCustomConstantInText('wmode', $wmode, $format);

		$paramLoop = (($loop == '' || $loop == Gpf::YES) ? 'true' : 'false');
		$format = Pap_Common_UserFields::replaceCustomConstantInText('loop', $paramLoop, $format);

		$format = $this->replaceUserConstants($format, $user);
		$format = $this->replaceUrlConstants($format, $user, $flags, '', $data1, $data2);
		$format = $this->replaceWidthHeightConstants($format, $flags);

		return $format;
	}
    /**
     * @deprecated
     */
    public static function replaceConstantsInInvoice($params) {
        if(isset($params['applyVat']) && $params['applyVat'] == Gpf::YES) {
    		$text = $params['payoutInvoiceWithVat'];
    	}  else {
    		$text = $params['payoutInvoice'];
    	}

  		$userFields = Pap_Common_UserFields::getInstance();
  		$userFields->setUser($params['user']);
  		$text = $userFields->replaceUserConstantsInText($text);

  		$text = Pap_Common_UserFields::replaceCustomConstantInText('vat_number', $params['vat_number'], $text);
  		$text = Pap_Common_UserFields::replaceCustomConstantInText('reg_number', $params['reg_number'], $text);
  		$text = Pap_Common_UserFields::replaceCustomConstantInText(Pap_Settings::VAT_PERCENTAGE_SETTING_NAME,
  		    $params['vatPercentage'], $text);
  		$text = Pap_Common_UserFields::replaceCustomConstantInText('payoutcurrency', $params['payout_currency'], $text);
  		$text = Pap_Common_UserFields::replaceCustomConstantInText('affiliate_note', $params['affiliateNote'], $text);
  		$text = Pap_Common_UserFields::replaceCustomConstantInText('payment', $params['payout_clear'], $text);
  		$text = Pap_Common_UserFields::replaceCustomConstantInText('payoutmethod', $params['payout_method'], $text);
  		$text = Pap_Common_UserFields::replaceCustomConstantInText('payment_vat_part', $params['payment_vat_part'], $text);
  		$text = Pap_Common_UserFields::replaceCustomConstantInText('payment_incl_vat', $params['payment_incl_vat'], $text);
  		$text = Pap_Common_UserFields::replaceCustomConstantInText('payment_excl_vat', $params['payment_excl_vat'], $text);

  		$text = Pap_Common_UserFields::replaceCustomConstantInText('date', Gpf_Common_DateUtils::getDateInLocaleFormat(), $text);
  		$text = Pap_Common_UserFields::replaceCustomConstantInText('time', Gpf_Common_DateUtils::getTimeInLocaleFormat(), $text);

  		return $text;
    }
    private function replaceVariables($affiliate, Pap_Common_Banner $banner, $channelcode, $content) {
        $this->userFields->setUser($affiliate);
        $content = $this->userFields->replaceUserConstantsInText($content);
        if ($channelcode == null) {
           $channelcode = '';
        }
        $content = Pap_Common_UserFields::replaceCustomConstantInText(Pap_Features_ZipBanner_UserFields::CHANNELID,$channelcode,$content);
     
        $content = $banner->replaceBannerConstants($content, $affiliate);
        $content = $banner->replaceUserConstants($content, $affiliate);
        $content = $banner->replaceUrlConstants($content, $affiliate, null, $banner->getDestinationUrl());

        return $content;
    }
Esempio n. 8
0
 /**
  * Replaces user constants like username, firstname, ... data25
  *
  * @return string
  */
 public function replaceClickConstants($text, $clickFieldsValues) {
     foreach($clickFieldsValues as $code => $value) {
         $text = Pap_Common_UserFields::replaceCustomConstantInText($code, $value, $text);
     }
     $text = Pap_Common_UserFields::removeCommentsInText($text);
     return $text;
 }
    /**
     * removes transaction fields values in standard format (${#data1#)
     *
     * @param string $text
     */
    public function removeTransactionConstantsInText($text) {
        $fields = $this->getTransactionFields();
        foreach($fields as $code => $value) {
            $text = Pap_Common_UserFields::replaceCustomConstantInText($code, '', $text);
        }

        return $text;
    }
Esempio n. 10
0
 public function replaceCustomConstantInText($code, $value, $context) {
     return Pap_Common_UserFields::replaceCustomConstantInText($code, $value, $context);
 }