本文整理匯總了PHP中Gpf_Rpc_Form::getFieldValue方法的典型用法代碼示例。如果您正苦於以下問題:PHP Gpf_Rpc_Form::getFieldValue方法的具體用法?PHP Gpf_Rpc_Form::getFieldValue怎麽用?PHP Gpf_Rpc_Form::getFieldValue使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Gpf_Rpc_Form
的用法示例。
在下文中一共展示了Gpf_Rpc_Form::getFieldValue方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: execute
protected function execute(Gpf_Rpc_Params $params)
{
$form = new Gpf_Rpc_Form($params);
if (!$form->getFieldValue(self::LICENSE_AGREE_NAME)) {
$form->setFieldError(self::LICENSE_AGREE_NAME, $this->_('You have to agree license.'));
$form->setErrorMessage($this->_('You have to agree license.'));
return $form;
}
try {
$setting = new Gpf_File_Settings();
$settingsArray = $setting->getAll();
if (is_array($settingsArray) && empty($settingsArray)) {
$this->addDBDefaultSettings($setting);
}
$setting->saveAll();
@chmod($setting->getSettingFileName(), 0777);
} catch (Exception $e) {
$form->setErrorMessage($this->_('Could not create settings file. Reason: %s', $e->getMessage()));
return $form;
}
try {
$info = $this->licenseManager->getLicense(trim($form->getFieldValue(self::LICENSE_ID_NAME)));
if (!$info->isApplicationCodeValid()) {
$form->setErrorMessage($this->_('Invalid license.'));
return $form;
}
} catch (Exception $e) {
$form->setErrorMessage($this->_('Could not validate license. Reason: %s', $e->getMessage()));
return $form;
}
$this->setNextStep($form);
return $form;
}
示例2: save
/**
* @anonym
* @service custom_separator write
* @param Gpf_Rpc_Params $params
* @return Gpf_Rpc_Form
*/
public function save(Gpf_Rpc_Params $params) {
$form = new Gpf_Rpc_Form($params);
Gpf_Settings::set(self::AFTER_SIGNUP_ACTION_CODE, $form->getFieldValue(self::AFTER_SIGNUP_ACTION_CODE));
Gpf_Settings::set(self::AFTER_SIGNUP_ACTION_CAMPAIGNID, $form->getFieldValue(self::AFTER_SIGNUP_ACTION_CAMPAIGNID));
$form->setInfoMessage($this->_('After signup action saved'));
return $form;
}
示例3: download
/**
* Download file from server
*
* @param Gpf_Rpc_Params $params
* @service db_file read
*/
public function download(Gpf_Rpc_Params $params)
{
try {
$form = new Gpf_Rpc_Form($params);
if (!strlen($form->getFieldValue('fileid'))) {
throw new Gpf_Exception("No fileid specified");
}
$this->file = new Gpf_Db_File();
$this->file->set('fileid', $form->getFieldValue("fileid"));
$this->file->load();
try {
if ($form->getFieldValue('attachment') == Gpf::YES) {
$this->isAttachment = true;
} else {
$this->isAttachment = false;
}
} catch (Exception $e) {
$this->isAttachment = false;
}
} catch (Gpf_DbEngine_NoRow $e) {
throw new Exception($this->_("File does not exist"));
} catch (Exception $e) {
throw new Exception($e->getMessage());
}
return $this;
}
示例4: save
/**
* @service mail_template write
* @param $fields
* @return Gpf_Rpc_Form
*/
public function save(Gpf_Rpc_Params $params)
{
$form = new Gpf_Rpc_Form($params);
try {
$mailTemplate = $this->loadMailTemplate($form->getFieldValue('templateid'));
} catch (Gpf_Exception $e) {
$form->setErrorMessage($this->_('Failed to load mail template with error: %s', $e->getMessage()));
return $form;
}
try {
$className = $mailTemplate->get(Gpf_Db_Table_MailTemplates::CLASS_NAME);
$objTemplate = new $className();
$templateVariables = new Gpf_Data_RecordSet();
$templateVariables->setHeader(array('id', 'value'));
foreach ($objTemplate->getTemplateVariables() as $code => $name) {
$record = $templateVariables->createRecord();
$record->set('id', $code);
$record->set('value', $form->getFieldValue('var_' . $code));
$templateVariables->add($record);
}
$objTemplate->setCachedVariableValues($templateVariables);
$objTemplate->addRecipient($form->getFieldValue('recipient'));
$objTemplate->sendNow();
} catch (Gpf_Exception $e) {
$form->setErrorMessage($this->_('Failed to send test mail with error: %s', $e->getMessage()));
return $form;
}
$form->setInfoMessage($this->_('Test mail was successfully queued'));
return $form;
}
示例5: execute
protected function execute(Gpf_Rpc_Params $params)
{
$form = new Gpf_Rpc_Form($params);
$hostname = $form->getFieldValue(self::FTP_HOSTNAME);
if (substr($hostname, 0, 6) == 'ftp://') {
$hostname = substr($hostname, 6);
}
$username = $form->getFieldValue(self::FTP_USERNAME);
$password = $form->getFieldValue(self::FTP_PASSWORD);
if ($password == '*****') {
$password = Gpf_Settings::get(Gpf_Settings_Gpf::FTP_PASSWORD);
}
$directory = $form->getFieldValue(self::FTP_DIRECTORY);
$checkResult = $this->checkFtpConnectionSetAndOk($hostname, $directory, $username, $password);
if ($checkResult !== true) {
$form->setErrorMessage($checkResult);
return $form;
}
$this->writeFtpInfo($hostname, $directory, $username, $password);
try {
$task = new Gpf_Install_UpdateApplicationFilesTask($this->distributionFileName);
$task->run();
} catch (Gpf_Tasks_LongTaskInterrupt $e) {
$this->setResponseType($form, self::PART_DONE_TYPE);
$form->setInfoMessage($e->getMessage());
return $form;
} catch (Exception $e) {
$form->setErrorMessage($this->_('Error during files update (%s)', $e->getMessage()));
return $form;
}
$form->setInfoMessage($this->_('Files updated'));
$this->setNextStep($form);
return $form;
}
示例6: saveRolePrivileges
/**
* Save role privileges
*
* @service role write
* @param Gpf_Rpc_Params $params
* @return Gpf_Rpc_Form
*/
public function saveRolePrivileges(Gpf_Rpc_Params $params)
{
$form = new Gpf_Rpc_Form($params);
$role = new Gpf_Db_Role();
$role->setId($form->getFieldValue('roleid'));
$role->load();
if (!strlen($role->getAccountId())) {
$form->setErrorMessage($this->_('It is not possible to changes privileges for default role %s', $role->getName()));
return $form;
}
//delete all privileges for selected role
Gpf_Db_Table_RolePrivileges::getInstance()->deleteAllPrivileges($role->getId());
//insert all privileges again to database
$objects = new Gpf_Data_RecordSet();
$objects->loadFromArray($form->getFieldValue('objects'));
foreach ($objects as $record) {
$rights = explode(',', $record->get('privileges'));
foreach ($rights as $right) {
$privilege = new Gpf_Db_RolePrivilege();
$privilege->setObject($record->get('object'));
$privilege->setRoleId($role->getId());
$privilege->setPrivilege($right);
$privilege->insert();
}
}
$form->setInfoMessage($this->_('Changes saved'));
return $form;
}
示例7: load
public function load(Gpf_Rpc_Form $form) {
$form->setField(self::MAX_COMMISSIONS_PER_REFERRAL_NUMBER,
$this->getCommissionsAttributeWithDefaultValue($form->getFieldValue('Id'), self::MAX_COMMISSIONS_PER_REFERRAL_NUMBER, -1));
$form->setField(self::MAX_COMMISSIONS_PER_REFERRAL_PERIOD,
$this->getCommissionsAttributeWithDefaultValue($form->getFieldValue('Id'), self::MAX_COMMISSIONS_PER_REFERRAL_PERIOD, -1));
}
示例8: save
/**
* @service tracking_mod_rewrite write
* @param $fields
*/
public function save(Gpf_Rpc_Params $params) {
$form = new Gpf_Rpc_Form($params);
$prefix = $form->getFieldValue(Pap_Settings::MOD_REWRITE_PREFIX_SETTING_NAME);
$separator = $form->getFieldValue(Pap_Settings::MOD_REWRITE_SEPARATOR_SETTING_NAME);
$suffix = $form->getFieldValue(Pap_Settings::MOD_REWRITE_SUFIX_SETTING_NAME);
$htaccessCode = $this->generateHtaccessCode($prefix, $separator, $suffix);
if($separator == '') {
$form->setErrorMessage("Separator cannot be empty!");
return $form;
}
Gpf_Settings::set(Pap_Settings::MOD_REWRITE_PREFIX_SETTING_NAME, $prefix);
Gpf_Settings::set(Pap_Settings::MOD_REWRITE_SEPARATOR_SETTING_NAME, $separator);
Gpf_Settings::set(Pap_Settings::MOD_REWRITE_SUFIX_SETTING_NAME, $suffix);
$form->setField("htaccess_code", $htaccessCode);
$form->setInfoMessage($this->_("Changes saved"));
Pap_Db_Table_CachedBanners::clearCachedBanners();
return $form;
}
示例9: report
/**
* @service report_problem write
*
* @param Gpf_Rpc_Params $params
* @return Gpf_Rpc_Form
*/
public function report(Gpf_Rpc_Params $params) {
$form = new Gpf_Rpc_Form($params);
$subject = 'PAP4: '.$form->getFieldValue('subject');
$message = 'License: '.$form->getFieldValue('licenseId').'<br>'.
'Product: <b>'.Gpf_Settings::get(Pap_Settings::BRANDING_TEXT_POST_AFFILIATE_PRO).' '.Gpf_Settings::get(Gpf_Settings_Gpf::VARIATION).'</b><br>'.
'Version: <b>'.Gpf_Application::getInstance()->getVersion().'</b><br>'.
'Url: <a href="'.Gpf_Paths::getInstance()->getFullBaseServerUrl().'">'.Gpf_Paths::getInstance()->getFullBaseServerUrl().'</a><br>'.
'-------------------------------------------------------------------------------<br>'.
$form->getFieldValue('message');
$mail = new Gpf_Db_Mail();
$mail->setSubject($subject);
$mail->setHtmlBody($message);
$mail->setFromMail($form->getFieldValue('email'));
$mail->setRecipients("support@qualityunit.com");
try {
$mail->insert();
$mail->scheduleNow(true);
$form->setInfoMessage($this->_("Email sent"));
} catch (Exception $e) {
$form->setErrorMessage($this->_("Error while sending mail"));
}
return $form;
}
示例10: save
/**
* @service general_setting write
* @param $fields
*/
public function save(Gpf_Rpc_Params $params) {
$form = new Gpf_Rpc_Form($params);
Gpf_Settings::set(Pap_Settings::PAYOUTS_PAYOUT_OPTIONS_SETTING_NAME, $form->getFieldValue("payoutOptions"));
Gpf_Settings::set(Pap_Settings::PAYOUTS_MINIMUM_PAYOUT_SETTING_NAME, $form->getFieldValue("minimumPayout"));
return $form;
}
示例11: save
/**
* @service invoice_format write
* @param $fields
*/
public function save(Gpf_Rpc_Params $params) {
$form = new Gpf_Rpc_Form($params);
Gpf_Settings::set(Pap_Settings::GENERATE_INVOICES, $form->getFieldValue(Pap_Settings::GENERATE_INVOICES));
Gpf_settings::set(Pap_Settings::INVOICE_BCC_RECIPIENT, $form->getFieldValue(Pap_Settings::INVOICE_BCC_RECIPIENT));
$this->checkAndSavePayoutInvoice($form, $form->getFieldValue('payoutInvoice'), Pap_Settings::PAYOUT_INVOICE);
return $form;
}