本文整理匯總了PHP中Gpf_Rpc_Form::addField方法的典型用法代碼示例。如果您正苦於以下問題:PHP Gpf_Rpc_Form::addField方法的具體用法?PHP Gpf_Rpc_Form::addField怎麽用?PHP Gpf_Rpc_Form::addField使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Gpf_Rpc_Form
的用法示例。
在下文中一共展示了Gpf_Rpc_Form::addField方法的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: load
/**
* @anonym
* @service custom_separator read
* @param Gpf_Rpc_Params $params
* @return Gpf_Rpc_Form
*/
public function load(Gpf_Rpc_Params $params) {
$form = new Gpf_Rpc_Form($params);
$form->addField(self::CUSTOM_SEPARATOR, Gpf_Settings::get(self::CUSTOM_SEPARATOR));
$form->addField(self::CUSTOM_FIELD_NUMBER, Gpf_Settings::get(self::CUSTOM_FIELD_NUMBER));
$form->addField(self::RESPONSE_TYPE, Gpf_Settings::get(self::RESPONSE_TYPE));
return $form;
}
示例2: load
/**
* @service coupon read
* @param $fields
* @return Gpf_Rpc_Form
*/
public function load(Gpf_Rpc_Params $params) {
$form = new Gpf_Rpc_Form($params);
$form->addField(Pap_Db_Table_Coupons::CODE, null);
$coupon = new Pap_Db_Coupon();
$coupon->setId($form->getFieldValue(Gpf_View_FormService::ID));
$coupon->setCode($form->getFieldValue(Gpf_View_FormService::ID));
$banner = new Pap_Features_Coupon_Coupon();
$affiliate = new Pap_Affiliates_User();
try {
$this->loadCoupon($coupon);
if (!$coupon->isValid()) {
return $form;
}
$banner->setPrimaryKeyValue($coupon->getBannerID());
$banner->load();
$affiliate->setPrimaryKeyValue($coupon->getUserID());
$affiliate->load();
$form->addField('couponid', $coupon->getId());
$form->addField('couponcode', $coupon->getCode());
$form->addField('name', $banner->getName());
$form->addField('description', $banner->getData1());
$this->fillFromUser($form, $affiliate);
Gpf_Plugins_Engine::extensionPoint('PostAffiliate.OfflineSaleForm.load', $form);
} catch (Gpf_Exception $e) {
}
return $form;
}
示例3: load
/**
* @service coupon read
* @param $fields
* @return Gpf_Rpc_Form
*/
public function load(Gpf_Rpc_Params $params) {
$this->form = new Gpf_Rpc_Form($params);
$affiliates = $this->getAffiliateCount();
$this->form->addField(self::AFFILIATES, $affiliates);
$this->form->addField(self::COUPONS_COUNT, round($affiliates * 1.1));
$this->form->addField(self::COUPONS_PER_AFF, 1);
return $this->form;
}
示例4: load
/**
* @service getting_started read
*
* @param Gpf_Rpc_Params $params
* @return Gpf_Rpc_Form
*/
public function load(Gpf_Rpc_Params $params) {
$form = new Gpf_Rpc_Form($params);
$checks = Gpf_Settings::get(Pap_Settings::GETTING_STARTED_CHECKS);
$checks = explode(",", $checks);
for ($i=1; $i<=self::CHECKS_COUNT; $i++) {
$form->addField("check".$i, (in_array($i, $checks)) ? GPF::YES : GPF::NO);
}
$form->addField("show", Gpf_Settings::get(Pap_Settings::GETTING_STARTED_SHOW));
return $form;
}
示例5: load
/**
* @service banner read
* @param $bannerId
* @return Gpf_Rpc_Form
*/
public function load(Gpf_Rpc_Params $params) {
$form = new Gpf_Rpc_Form($params);
$bannerFactory = new Pap_Common_Banner_Factory();
$site = $bannerFactory->getBanner($form->getFieldValue(Gpf_View_FormService::ID));
$form->addField('htAccessCode', $site->getHtaccessCode());
return $form;
}
示例6: load
/**
*
* @service compressed_commission_placement_model read
* @param $fields
* @return Gpf_Rpc_Form
*/
public function load(Gpf_Rpc_Params $params) {
$form = new Gpf_Rpc_Form($params);
$form->addField(Pap_Features_CompressedCommissionPlacementModel_Definition::ACTION, Gpf_Settings::get(Pap_Features_CompressedCommissionPlacementModel_Definition::ACTION));
$form->addField(Pap_Features_CompressedCommissionPlacementModel_Definition::RECURRENCE, Gpf_Settings::get(Pap_Features_CompressedCommissionPlacementModel_Definition::RECURRENCE));
$form->addField(Pap_Features_CompressedCommissionPlacementModel_Definition::PROCESSING_ENABLED, Gpf_Settings::get(Pap_Features_CompressedCommissionPlacementModel_Definition::PROCESSING_ENABLED));
$form->addField(Pap_Db_Table_Rules::EQUATION, Gpf_Settings::get(Pap_Features_CompressedCommissionPlacementModel_Definition::RULE_EQUATION));
$form->addField(Pap_Db_Table_Rules::EQUATION_VALUE_1, Gpf_Settings::get(Pap_Features_CompressedCommissionPlacementModel_Definition::RULE_EQUATION_VALUE1));
$form->addField(Pap_Db_Table_Rules::EQUATION_VALUE_2, Gpf_Settings::get(Pap_Features_CompressedCommissionPlacementModel_Definition::RULE_EQUATION_VALUE2));
$form->addField(Pap_Db_Table_Rules::STATUS, Gpf_Settings::get(Pap_Features_CompressedCommissionPlacementModel_Definition::RULE_STATUS));
$form->addField(Pap_Db_Table_Rules::WHAT, Gpf_Settings::get(Pap_Features_CompressedCommissionPlacementModel_Definition::RULE_WHAT));
return $form;
}
示例7: load
/**
* @anonym
* @service recurring_commissions_config read
* @param Gpf_Rpc_Params $params
* @return Gpf_Rpc_Form
*/
public function load(Gpf_Rpc_Params $params) {
$form = new Gpf_Rpc_Form($params);
$apiTriggerred = Gpf::NO;
try {
$this->createPlannedTask()->loadFromData();
} catch (Gpf_DbEngine_NoRowException $e) {
$apiTriggerred = Gpf::YES;
}
$form->addField(self::API_TRIGGERRED_COMMISSIONS, $apiTriggerred);
return $form;
}
示例8: loadNoRpc
/**
* Load Wallpaper settings to form
*/
public function loadNoRpc()
{
$form = new Gpf_Rpc_Form();
$form->addField(self::WALLPAPER, '');
$form->addField(self::WALLPAPER_POSITION, 'S');
$form->addField(self::WALLPAPER_TYPE, 'N');
$form->addField(self::BACKGROUND_COLOR, '#000000');
try {
$attributes = Gpf_Db_UserAttribute::getSettingsForGroupOfUsers(array(self::WALLPAPER, self::WALLPAPER_TYPE, self::WALLPAPER_POSITION, self::BACKGROUND_COLOR), array(Gpf_Session::getInstance()->getAuthUser()->getAccountUserId()));
if (isset($attributes[Gpf_Session::getInstance()->getAuthUser()->getAccountUserId()])) {
$attributes = $attributes[Gpf_Session::getInstance()->getAuthUser()->getAccountUserId()];
if (isset($attributes[self::WALLPAPER])) {
$form->setField(self::WALLPAPER, $attributes[self::WALLPAPER]);
}
if (isset($attributes[self::WALLPAPER_TYPE])) {
$form->setField(self::WALLPAPER_TYPE, $attributes[self::WALLPAPER_TYPE]);
}
if (isset($attributes[self::WALLPAPER_POSITION])) {
$form->setField(self::WALLPAPER_POSITION, $attributes[self::WALLPAPER_POSITION]);
}
if (isset($attributes[self::BACKGROUND_COLOR])) {
$form->setField(self::BACKGROUND_COLOR, $attributes[self::BACKGROUND_COLOR]);
}
}
} catch (Gpf_Exception $e) {
$form->setErrorMessage($e->getMessage() . ' ' . $e->getLine());
}
return $form;
}
示例9: save
/**
* @service currency write
* @param $fields
*/
public function save(Gpf_Rpc_Params $params) {
$form = new Gpf_Rpc_Form($params);
$dbRow = $this->createDbRowObject();
$dbRow->setIsDefault(Gpf_Db_Currency::DEFAULT_CURRENCY_VALUE);
try {
$dbRow->loadFromData();
} catch (Gpf_DbEngine_NoRowException $e) {
$dbRow->setAccountId(Gpf_Session::getAuthUser()->getAccountId());
}
$oldDbRow = clone $dbRow;
$form->fill($dbRow);
foreach ($oldDbRow as $name => $oldValue) {
if ($dbRow->get($name) != $oldValue) {
$form->addField('changed', 'Y');
break;
}
}
try {
$dbRow->save();
Gpf_Plugins_Engine::extensionPoint('PostAffiliate.CurrencyForm.save', $form);
} catch (Exception $e) {
$form->setErrorMessage($e->getMessage());
return $form;
}
$form->load($dbRow);
$form->setInfoMessage($this->getDbRowObjectName().$this->_(" saved"));
return $form;
}
示例10: setAuthenticationSucesful
protected function setAuthenticationSucesful(Gpf_Rpc_Form $loginForm, Gpf_Auth_User $authUser)
{
try {
if ($loginForm->getFieldValue(self::REMEMBER_ME) == Gpf::YES) {
$authUser->saveRememberMeCookie();
}
} catch (Gpf_Exception $e) {
}
$authUser->setLanguage($loginForm->getFieldValue(self::LANGUAGE));
Gpf_Db_UserAttribute::saveAttribute(self::LANGUAGE, $loginForm->getFieldValue(self::LANGUAGE), $authUser->getAccountUserId());
Gpf_Db_UserAttribute::saveAttribute(self::TIME_OFFSET, Gpf_Session::getInstance()->getTimeOffset(), $authUser->getAccountUserId());
Gpf_Http::setCookie(self::COOKIE_LANGUAGE, $authUser->getLanguage(), time() + 20000000, '/');
$loginForm->addField("S", Gpf_Session::getInstance()->getId());
$loginForm->setInfoMessage($this->_("User authenticated. Logging in."));
Gpf_Log::info($this->_sys("User %s authenticated. Logging in.", $authUser->getUsername()));
}
示例11: load
/**
* @service quicklaunch read
* @param Gpf_Rpc_Params $params
*/
public function load(Gpf_Rpc_Params $params)
{
$form = new Gpf_Rpc_Form();
$form->addField(self::SHOW_QUICK_LAUNCH, $this->getShowQuickLaunch());
return $form;
}
示例12: importLanguage
/**
* Import language specified in parameter fileName
*
* @service language import
* @param Gpf_Rpc_Params $params
* @return Gpf_Rpc_Form
*/
public function importLanguage(Gpf_Rpc_Params $params)
{
$form = new Gpf_Rpc_Form($params);
//Read metadata of file
$file = new Gpf_Io_Csv_Reader($form->getFieldValue("fileName"), ';', '"', array('source', 'translation', 'type', 'module', 'status', 'customer'));
$file->setMaxLinesToRead(10);
$language = new Gpf_Lang_CsvLanguage();
$language->loadFromCsvFile($file);
try {
$importer = new Gpf_Lang_ImportLanguageTask($form->getFieldValue("fileName"), $language->getCode(), false);
$importer->run();
} catch (Gpf_Tasks_LongTaskInterrupt $e) {
$form->addField('progress', 'PROGRESS');
$form->setFieldError('progress', $e->getMessage());
$form->setErrorMessage($e->getMessage());
return $form;
}
$form->setInfoMessage($this->_('%s (%s) imported', $language->getMetaValue(Gpf_Lang_CsvLanguage::LANG_NAME), $language->getMetaValue(Gpf_Lang_CsvLanguage::LANG_ENG_NAME)));
return $form;
}
示例13: loadCoupon
public function loadCoupon(Gpf_Rpc_Form $form) {
$form->addField('hidedatanumber', Gpf_Settings::get(SaleFraudProtection_Config::PARAM_NAME));
}