当前位置: 首页>>代码示例>>PHP>>正文


PHP Gpf_Rpc_Form::existsField方法代码示例

本文整理汇总了PHP中Gpf_Rpc_Form::existsField方法的典型用法代码示例。如果您正苦于以下问题:PHP Gpf_Rpc_Form::existsField方法的具体用法?PHP Gpf_Rpc_Form::existsField怎么用?PHP Gpf_Rpc_Form::existsField使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Gpf_Rpc_Form的用法示例。


在下文中一共展示了Gpf_Rpc_Form::existsField方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: generatePdfFromHtml

 /**
  * Get pdf banner preview for merchant
  * 
  * @service banner read
  * @param Gpf_Rpc_Params $params
  */
 public function generatePdfFromHtml(Gpf_Rpc_Params $params) {  
     $form = new Gpf_Rpc_Form($params);   
     if ($form->existsField('html')) {
         $html = $form->getFieldValue('html');
     } else {
         throw new Gpf_Exception($this->_("Html data is not defined"));
     }
     
     if ($form->existsField('fileName')) {
         $fileName = $this->correctFilename($form->getFieldValue('fileName'));
     } else {
         throw new Gpf_Exception($this->_("File name is not defined"));
     }
 	
     if ($form->existsField('affiliate')) {
         try {
             $this->initAffiliate($form->getFieldValue('affiliate'));
         } catch (Gpf_DbEngine_NoRowException $e) {
         	return $this->getFormResponse($this->_('Affiliate is not defined'));
         }
     }
     $html = $this->decodeBanner($html, null, 0);
     $html = htmlspecialchars_decode($html);
     $this->generatePDF($html);
     
     return new Pap_Common_Banner_PdfGeneratorResponse($fileName, $this->pdf);        
 }
开发者ID:AmineCherrai,项目名称:rostanvo,代码行数:33,代码来源:PDFBannerGenerator.class.php

示例2: save

    /**
     * @service affiliate_email_notification write
     * @param $fields
     */
    public function save(Gpf_Rpc_Params $params) {
        $form = new Gpf_Rpc_Form($params);

        $bannerFactory = new Pap_Common_Banner_Factory();
        $banner = $bannerFactory->getBanner($form->getFieldValue('bannerId'));

        $bodyHtml = $banner->getPreview($this->getUser());

        if($form->existsField('personalMessage')){
            $bodyHtml = $this->replacePersonalMessage($form,$bodyHtml);
        }

        $form->setField('body_html',$bodyHtml);

        $recipientsList = $this->makeRecepientsList($form);

        if(count($recipientsList) == 0) {
            $form->setErrorMessage($this->_("Please add recepients."));
            return $form;
        }

        $this->saveRecipientsList($form->getFieldValue('recipients'));
        $task = $this->createLongTask($form, $this->createMassMailTemplate($form,'Pap_Mail_AffiliateMailTemplate'), $recipientsList);
        $task->insertTask();

        $form->setInfoMessage($this->_("Thank you, your mail will be delivered within next few minutes."));
        return $form;
    }
开发者ID:AmineCherrai,项目名称:rostanvo,代码行数:32,代码来源:SendToFriendForm.class.php

示例3: fillSave

    protected function fillSave(Gpf_Rpc_Form $form, Gpf_DbEngine_RowBase $dbRow) {
        if ($form->existsField(Gpf_Db_Table_Users::ACCOUNTID) && $form->getFieldValue(Gpf_Db_Table_Users::ACCOUNTID) == '') {
            $form->setField(Gpf_Db_Table_Users::ACCOUNTID, $dbRow->get(Gpf_Db_Table_Users::ACCOUNTID));
        }
        if ($form->existsField(Gpf_Db_Table_Users::ROLEID) && $form->getFieldValue(Gpf_Db_Table_Users::ROLEID) == '') {
            $form->setField(Gpf_Db_Table_Users::ROLEID, $dbRow->get(Gpf_Db_Table_Users::ROLEID));
        }

        $oldPassword = $dbRow->getPassword();
        $oldUsername = $dbRow->getUsername();

        parent::fillSave($form, $dbRow);

        if (Gpf_Application::isDemo() && $oldUsername == Pap_Branding::DEMO_MERCHANT_USERNAME) {
            $dbRow->setPassword($oldPassword);
            $dbRow->setUsername($oldUsername);
        }
    }
开发者ID:AmineCherrai,项目名称:rostanvo,代码行数:18,代码来源:AdminForm.class.php

示例4: create

 /**
  * @param $form
  * @return Pap_Features_RebrandPdfBanner_Banner
  */
 public static function create(Gpf_Rpc_Params $params){
     $form = new Gpf_Rpc_Form($params);
     if($form->existsField(self::BANNERID)){
         $banner = new Pap_Features_RebrandPdfBanner_Banner();
         $banner->setId($form->getFieldValue(self::BANNERID));
         return $banner;
     }
     throw new Gpf_Exception('No banner Id Found');
 }
开发者ID:AmineCherrai,项目名称:rostanvo,代码行数:13,代码来源:Banner.class.php

示例5: initValidators

	public function initValidators(Gpf_Rpc_Form $form) {
		if (!($form->existsField('isdesign') && $form->getFieldValue('isdesign') == Gpf::YES)) {
			$form->addValidator(new Gpf_Rpc_Form_Validator_MandatoryValidator(), Pap_Db_Table_Banners::NAME, $this->_('name'));
			$form->addValidator(new Gpf_Rpc_Form_Validator_MandatoryValidator(), Pap_Db_Table_Banners::STATUS, $this->_('status'));
			$form->addValidator(new Gpf_Rpc_Form_Validator_MandatoryValidator(), Pap_Db_Table_Banners::SIZE, $this->_('size'));
			$form->addValidator(new Gpf_Rpc_Form_Validator_MandatoryValidator(), Pap_Db_Table_Banners::DATA1, $this->_('description'));
			$form->addValidator(new Gpf_Rpc_Form_Validator_MandatoryValidator(), Pap_Db_Table_Banners::DATA2, $this->_('maximum coupons per affiliate'));
			$form->addValidator(new Gpf_Rpc_Form_Validator_IntegerNumberPositiveValidator(), Pap_Db_Table_Banners::DATA2);
		}
	}
开发者ID:AmineCherrai,项目名称:rostanvo,代码行数:10,代码来源:Coupon.class.php

示例6: save

    /**
     * @service cookies_setting write
     * @param $fields
     */
    public function save(Gpf_Rpc_Params $params) {
        $form = new Gpf_Rpc_Form($params);

        Gpf_Settings::set(Pap_Settings::URL_TO_P3P, $form->getFieldValue(Pap_Settings::URL_TO_P3P));
        Gpf_Settings::set(Pap_Settings::P3P_POLICY_COMPACT, $form->getFieldValue(Pap_Settings::P3P_POLICY_COMPACT));
        if ($form->existsField(Pap_Settings::OVERWRITE_COOKIE)) {
            Gpf_Settings::set(Pap_Settings::OVERWRITE_COOKIE, $form->getFieldValue(Pap_Settings::OVERWRITE_COOKIE));    
        }        
        Gpf_Settings::set(Pap_Settings::DELETE_COOKIE, $form->getFieldValue(Pap_Settings::DELETE_COOKIE));
        Gpf_Settings::set(Pap_Settings::COOKIE_DOMAIN, $form->getFieldValue(Pap_Settings::COOKIE_DOMAIN));

        $form->setInfoMessage($this->_("Cookies settings saved"));
        return $form;
    }
开发者ID:AmineCherrai,项目名称:rostanvo,代码行数:18,代码来源:CookiesForm.class.php

示例7: addAttachements

 /**
  * Add attachments to mail template
  *
  * @param $dbTemplate
  * @param $form
  */
 private function addAttachements(Gpf_Db_MailTemplate $dbTemplate, Gpf_Rpc_Form $form)
 {
     if (!$form->existsField('uploadedFiles') || !strlen(trim($form->getFieldValue('uploadedFiles')))) {
         return;
     }
     $imageIds = Gpf_Db_MailTemplate::getIncludedImageFileIds($form->getFieldValue('body_html'));
     $uploads = explode(',', $form->getFieldValue('uploadedFiles'));
     foreach ($uploads as $uploadFileId) {
         $dbTemplateAttachment = new Gpf_Db_MailTemplateAttachment();
         $dbTemplateAttachment->setFileId($uploadFileId);
         $dbTemplateAttachment->setTemplateId($dbTemplate->getId());
         $dbTemplateAttachment->setIsIncludedImage(in_array($uploadFileId, $imageIds));
         $dbTemplateAttachment->insert();
     }
 }
开发者ID:AmineCherrai,项目名称:rostanvo,代码行数:21,代码来源:SendBroadcastMail.class.php

示例8: getCommTypeAttr

    /**
     * @return Pap_Db_CommissionTypeAttribute
     */
    private function getCommTypeAttr(Gpf_Rpc_Form $form, $attributeName) {
        if (!$form->existsField($attributeName)) {
            return false;
        }
        $commTypeAttr = new Pap_Db_CommissionTypeAttribute();
        $commTypeAttr->setCommissionTypeId($form->getFieldValue("Id"));
        $commTypeAttr->setName($attributeName);

        try {
            $commTypeAttr->loadFromData(array(Pap_Db_Table_CommissionTypeAttributes::COMMISSION_TYPE_ID,
            Pap_Db_Table_CommissionTypeAttributes::NAME));
        } catch (Gpf_Exception $e) {
        }
        $commTypeAttr->setValue($form->getFieldValue($attributeName));
        return $commTypeAttr;
    }
开发者ID:AmineCherrai,项目名称:rostanvo,代码行数:19,代码来源:SplitCommissionsForm.class.php

示例9: save

 /**
  * @service getting_started write
  *
  * @param Gpf_Rpc_Params $params
  * @return Gpf_Rpc_Form
  */
 public function save(Gpf_Rpc_Params $params) {
     $form = new Gpf_Rpc_Form($params);
     $checks = array();
     
     for ($i=1; $i<=self::CHECKS_COUNT; $i++) {
         if ($form->existsField("check".$i) &&
             $form->getFieldValue("check".$i) == GPF::YES) {
                 $checks[] = $i;
             }
     }
     if (count($checks) > 0) {
         Gpf_Settings::set(Pap_Settings::GETTING_STARTED_CHECKS, implode(",", $checks));
     } else {
         Gpf_Settings::set(Pap_Settings::GETTING_STARTED_CHECKS, "");
     }
     
     Gpf_Settings::set(Pap_Settings::GETTING_STARTED_SHOW, $form->getFieldValue("show"));
     $form->setInfoMessage("");
     return $form;
 }
开发者ID:AmineCherrai,项目名称:rostanvo,代码行数:26,代码来源:GettingStarted.class.php

示例10: checkBeforeSave

    protected function checkBeforeSave(Pap_Common_Campaign $row, Gpf_Rpc_Form $form, $operationType) {
        /**
         $this->checkCampaignValidity($row, $form, $operationType);
         */

        if($row->getIsDefault() && $row->get('rstatus') <> Pap_Db_Campaign::CAMPAIGN_STATUS_ACTIVE) {
            throw new Gpf_Exception($this->_("Error, you cannot deactivate Default campaign"));
        }

        if($row->get('rstatus') == "") {
            throw new Gpf_Exception($this->_("You have to specify status of campaign (rstatus field)"));
        }

        /*
         if ($row->getIsDefault() || $row->getCampaignType() == null) {
         if ($form->existsField('rtype') && $form->getFieldValue('rtype') != Pap_Db_Campaign::CAMPAIGN_TYPE_PUBLIC) {
         throw new Gpf_Exception($this->_("Type of default campaign must be public"));
         }
         }
         */
        if ($row->getDateInserted() == null || $row->getDateInserted() == '') {
            $row->setDateInserted(Gpf_Common_DateUtils::now());
        }
        if (!$form->existsField('accountid') || $form->getFieldValue('accountid') == '') {
            $row->set("accountid", Gpf_Session::getAuthUser()->getAccountId());
        }

        return true;
    }
开发者ID:AmineCherrai,项目名称:rostanvo,代码行数:29,代码来源:CampaignForm.class.php

示例11: getFieldValue

 protected function getFieldValue(Gpf_Rpc_Form $form, $fieldName) {
 	if($form->existsField($fieldName)) {
 		return $form->getFieldValue($fieldName);
 	}
 	return '';
 }
开发者ID:AmineCherrai,项目名称:rostanvo,代码行数:6,代码来源:TaskSettingsFormBase.class.php

示例12: setAffiliateLanguage

    public static function setAffiliateLanguage(Gpf_Rpc_Form $form, $accountUserId) {
        if (!$form->existsField('lang') || $form->getFieldValue('lang') == '') {
            self::setDefaultLanguageToAffiliate($accountUserId);
            return;
        }

        if (!Gpf_Lang_Dictionary::isLanguageSupported($form->getFieldValue('lang'))) {
            self::setDefaultLanguageToAffiliate($accountUserId);
            return;
        }

        $attribute = new Gpf_Db_UserAttribute();
        $attribute->setName(Gpf_Auth_User::LANGUAGE_ATTRIBUTE_NAME);
        $attribute->set(Gpf_Db_Table_UserAttributes::VALUE, $form->getFieldValue('lang'));
        $attribute->setAccountUserId($accountUserId);
        $attribute->save();
    }
开发者ID:AmineCherrai,项目名称:rostanvo,代码行数:17,代码来源:AffiliateForm.class.php

示例13: getAccountId

 	/**
 	 * @param Gpf_Rpc_Form
 	 * @return String
 	 */
  private function getAccountId(Gpf_Rpc_Form $form) {
      if (Gpf_Session::getAuthUser()->isMasterMerchant()) {
          if ($form->existsField('campaignid')) {
              return $this->getAccountIdFromCampaignId($form->getFieldValue('campaignid'));
          }
          if ($form->existsField('id')) {
              return $this->getAccountIdFromBannerId($form->getFieldValue('id'));
          }
      }
      return Gpf_Session::getAuthUser()->getAccountId();
  }
开发者ID:AmineCherrai,项目名称:rostanvo,代码行数:15,代码来源:BannerForm.class.php

示例14: getFieldValue

 private function getFieldValue(Gpf_Rpc_Form $form, $fieldName) {
 	if($form->existsField($fieldName)) {
 		return $form->getFieldValue($fieldName);
 	}
 	return Gpf::NO;
 }
开发者ID:AmineCherrai,项目名称:rostanvo,代码行数:6,代码来源:EmailNotificationsForm.class.php

示例15: getAndSetRType

 protected function getAndSetRType(Gpf_Rpc_Form $form, Gpf_DbEngine_RowBase $dbRow) {
     if ($form->existsField(Pap_Db_Table_Transactions::R_TYPE)) {
         $rtype = $form->getFieldValue(Pap_Db_Table_Transactions::R_TYPE);
         $form->setField(Pap_Db_Table_Transactions::R_TYPE, $rtype);
         $dbRow->set(Pap_Db_Table_Transactions::R_TYPE, $rtype);
         return;
     }
     try {
         $commType = $form->getFieldValue(Pap_Db_Table_Transactions::COMMISSIONTYPEID);
         $commTypeObj = $this->getCommType($commType);
         $rtype = $commTypeObj->getType();
     } catch (Gpf_Data_RecordSetNoRowException $e) {
         if ($form->existsField(Pap_Db_Table_Transactions::COMMISSIONTYPEID)) {
             $rtype = $form->getFieldValue(Pap_Db_Table_Transactions::COMMISSIONTYPEID);
         }
     } catch (Gpf_DbEngine_NoRowException $e) {
         if ($form->existsField(Pap_Db_Table_Transactions::COMMISSIONTYPEID)) {
             $rtype = $form->getFieldValue(Pap_Db_Table_Transactions::COMMISSIONTYPEID);
         }
     }
     $form->setField(Pap_Db_Table_Transactions::R_TYPE, $rtype);
     $dbRow->set(Pap_Db_Table_Transactions::R_TYPE, $rtype);
 }
开发者ID:AmineCherrai,项目名称:rostanvo,代码行数:23,代码来源:TransactionsForm.class.php


注:本文中的Gpf_Rpc_Form::existsField方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。