Ejemplo 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()));
    }
Ejemplo n.º 2
0
	private function getTitle(Pap_Common_User $user) {
		$title = $this->get(Pap_Db_Table_Banners::DATA1);
		
		$userFields = Pap_Common_UserFields::getInstance();
		$userFields->setUser($user);
		$title = $userFields->replaceUserConstantsInText($title);
		
		return $title;
	}
Ejemplo n.º 3
0
    static function getAll(){
        $fields = Pap_Common_UserFields::getInstance()->getUserFields(array('M', 'O', 'R'), Gpf::YES);
        $fields[self::VAR_AFF_SIGN] = Gpf_Lang::_('Affiliate Signup');
        $fields[self::VAR_DEST_URL] = Gpf_Lang::_('Destination URL');
        $fields[self::VAR_AFF_ID] = Gpf_Lang::_('Affiliate ID');
        $fields[self::BANNER_ID] = Gpf_Lang::_('Banner ID');

        $valueContext = new Gpf_Plugins_ValueContext($fields);
        Gpf_Plugins_Engine::extensionPoint('PostAffiliate.RebrandPdfBanner_Variables.getAll', $valueContext);
        return $valueContext->get();
    }
Ejemplo n.º 4
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;
    }
Ejemplo n.º 5
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;
    }
Ejemplo n.º 6
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;
	}
Ejemplo n.º 7
0
    /**
     * returns array of user fields
     *
     * @return unknown
     */
    public function getUserFields($type = array('M', 'O', 'R'), $mainFields = null) {
        if (is_array(self::$userFields)) {
            return self::$userFields;
        }
        $ffTable = Gpf_Db_Table_FormFields::getInstance();
        $formFields = $ffTable->getFieldsNoRpc("affiliateForm", $type, $mainFields);

        self::$userFields = array();
        self::$userFields['firstname'] = $this->_('First Name');
        self::$userFields['lastname'] = $this->_('Last Name');
        self::$userFields['username'] = $this->_('Username');
        self::$userFields['password'] = $this->_('Password');
        self::$userFields['ip'] = $this->_('IP');
        self::$userFields['photo'] = $this->_('Photo');

        foreach($formFields as $record) {
            $code = $record->get('code');
            $name = $record->get('name');
            self::$userFields[$code] = $name;
        }

        return self::$userFields;
    }
    /**
     * @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;
    }
Ejemplo n.º 9
0
    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;
    }
Ejemplo n.º 10
0
 private function replaceVariables() {
     $userFields = Pap_Common_UserFields::getInstance();
     $userFields->setUser($this->user);
     $this->content = $userFields->replaceUserConstantsInText($this->content);
     $this->content = $this->replaceRelativeLinks($this->content);
     $this->content = $this->replaceAbsoluteLinks($this->content);
 }
Ejemplo n.º 11
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;
 }
 /**
  * remove user constants in standard format {*some comment*}
  * @throws Gpf_Exception
  *
  * @param string $text
  */
 public function removeTransactionCommentsInText($text) {
     return Pap_Common_UserFields::removeCommentsInText($text);
 }
Ejemplo n.º 13
0
 public function replaceCustomConstantInText($code, $value, $context) {
     return Pap_Common_UserFields::replaceCustomConstantInText($code, $value, $context);
 }
Ejemplo n.º 14
0
    private function setUserCustomFields(Pap_Common_User $user, $preffix = '') {
        Pap_Common_UserFields::getInstance()->setUser($user);
        $formFields = Pap_Common_UserFields::getInstance()->getUserFieldsValues(Gpf::YES);

        foreach($formFields as $code => $value) {
            $this->setVariable($preffix.$code, $value);
        }

        $this->setVariable($preffix.Pap_Db_Table_Users::PARENTUSERID, Pap_Common_UserFields::getInstance()->getUserFieldValue(Pap_Db_Table_Users::PARENTUSERID));
    }
Ejemplo n.º 15
0
    /**
     * @param Pap_Common_User $user
     * @return string
     */
    protected function getDescription(Pap_Common_User $user) {
        $description = $this->get(Pap_Db_Table_Banners::DATA2);

        $userFields = Pap_Common_UserFields::getInstance();
        $userFields->setUser($user);
        $description = $userFields->replaceUserConstantsInText($description);

        return $description;
    }