本文整理汇总了PHP中Submit::setValue方法的典型用法代码示例。如果您正苦于以下问题:PHP Submit::setValue方法的具体用法?PHP Submit::setValue怎么用?PHP Submit::setValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Submit
的用法示例。
在下文中一共展示了Submit::setValue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct($userId)
{
parent::__construct();
$data = OW::getEventManager()->call("photo.entity_albums_find", array("entityType" => "user", "entityId" => $userId));
$albums = empty($data["albums"]) ? array() : $data["albums"];
$source = BOL_PreferenceService::getInstance()->getPreferenceValue("pcgallery_source", $userId);
$this->assign("source", $source == "album" ? "album" : "all");
$selectedAlbum = BOL_PreferenceService::getInstance()->getPreferenceValue("pcgallery_album", $userId);
$form = new Form("pcGallerySettings");
$form->setEmptyElementsErrorMessage(null);
$form->setAction(OW::getRouter()->urlFor("PCGALLERY_CTRL_Gallery", "saveSettings"));
$element = new HiddenField("userId");
$element->setValue($userId);
$form->addElement($element);
$element = new Selectbox("album");
$element->setHasInvitation(true);
$element->setInvitation(OW::getLanguage()->text("pcgallery", "settings_album_invitation"));
$validator = new PCGALLERY_AlbumValidator();
$element->addValidator($validator);
$albumsPhotoCount = array();
foreach ($albums as $album) {
$element->addOption($album["id"], $album["name"] . " ({$album["photoCount"]})");
$albumsPhotoCount[$album["id"]] = $album["photoCount"];
if ($album["id"] == $selectedAlbum) {
$element->setValue($album["id"]);
}
}
OW::getDocument()->addOnloadScript(UTIL_JsGenerator::composeJsString('window.pcgallery_settingsAlbumCounts = {$albumsCount};', array("albumsCount" => $albumsPhotoCount)));
$element->setLabel(OW::getLanguage()->text("pcgallery", "source_album_label"));
$form->addElement($element);
$submit = new Submit("save");
$submit->setValue(OW::getLanguage()->text("pcgallery", "save_settings_btn_label"));
$form->addElement($submit);
$this->addForm($form);
}
示例2: __construct
public function __construct($ctrl)
{
parent::__construct('settings-form');
$configs = OW::getConfig()->getValues('yncontactimporter');
$ctrl->assign('configs', $configs);
$l = OW::getLanguage();
$miValidator = new IntValidator(1, 999);
$miValidator->setErrorMessage($l->text('yncontactimporter', 'max_validation_error', array('min' => 1, 'max' => 999)));
//Contacts per page
$textField['contact_per_page'] = new TextField('contact_per_page');
$textField['contact_per_page']->setLabel($l->text('yncontactimporter', 'settings_contact_per_page'))->setValue($configs['contact_per_page'])->addValidator($miValidator)->setRequired(true);
$this->addElement($textField['contact_per_page']);
//Maximum invite per times
$textField['max_invite_per_times'] = new TextField('max_invite_per_times');
$textField['max_invite_per_times']->setLabel($l->text('yncontactimporter', 'settings_max_invite_per_times'))->setValue($configs['max_invite_per_times'])->addValidator($miValidator)->setRequired(true);
$this->addElement($textField['max_invite_per_times']);
//Default invite message
$textField['default_invite_message'] = new Textarea('default_invite_message');
$textField['default_invite_message']->setLabel($l->text('yncontactimporter', 'settings_default_invite_message'))->setValue($configs['default_invite_message']);
$this->addElement($textField['default_invite_message']);
// Logo width
$textField['logo_width'] = new TextField('logo_width');
$textField['logo_width']->setLabel($l->text('yncontactimporter', 'settings_logo_width'))->setValue($configs['logo_width'])->addValidator($miValidator)->setRequired(true);
$this->addElement($textField['logo_width']);
// Logo Height
$textField['logo_height'] = new TextField('logo_height');
$textField['logo_height']->setLabel($l->text('yncontactimporter', 'settings_logo_height'))->setValue($configs['logo_height'])->addValidator($miValidator)->setRequired(true);
$this->addElement($textField['logo_height']);
$submit = new Submit('submit');
$submit->setValue($l->text('yncontactimporter', 'save_btn_label'));
$submit->addAttribute('class', 'ow_ic_save ow_positive');
$this->addElement($submit);
}
示例3: __construct
/**
* Class constructor
*
*/
public function __construct()
{
parent::__construct('configSaveForm');
$language = OW::getLanguage();
$field = new TextField('public_key');
$field->addValidator(new ConfigRequireValidator());
$this->addElement($field);
$field = new CheckboxField('billing_enabled');
$this->addElement($field);
// submit
$submit = new Submit('save');
$submit->setValue($language->text('admin', 'save_btn_label'));
$this->addElement($submit);
$promoUrl = new TextField('app_url');
$promoUrl->setRequired();
$promoUrl->addValidator(new UrlValidator());
$promoUrl->setLabel($language->text('skandroid', 'app_url_label'));
$promoUrl->setDescription($language->text('skandroid', 'app_url_desc'));
$promoUrl->setValue(OW::getConfig()->getValue('skandroid', 'app_url'));
$this->addElement($promoUrl);
$smartBanner = new CheckboxField('smart_banner');
$smartBanner->setLabel($language->text('skandroid', 'smart_banner_label'));
$smartBanner->setDescription($language->text('skandroid', 'smart_banner_desc'));
$smartBanner->setValue(OW::getConfig()->getValue('skandroid', 'smart_banner'));
$this->addElement($smartBanner);
}
示例4: __construct
public function __construct()
{
parent::__construct('payeer-config-form');
$language = OW::getLanguage();
$billingService = BOL_BillingService::getInstance();
$gwKey = BILLINGPAYEER_CLASS_PayeerAdapter::GATEWAY_KEY;
$element = new TextField('m_key');
$element->setValue($billingService->getGatewayConfigValue($gwKey, 'm_key'));
$this->addElement($element);
$element = new TextField('m_shop');
$element->setValue($billingService->getGatewayConfigValue($gwKey, 'm_shop'));
$this->addElement($element);
$element = new Selectbox('m_curr');
$element->setValue($billingService->getGatewayConfigValue($gwKey, 'm_curr'))->setHasInvitation(false)->addOption('RUB', 'RUB')->addOption('usd', 'USD');
$this->addElement($element);
$element = new Selectbox('lang');
$element->setValue($billingService->getGatewayConfigValue($gwKey, 'lang'))->setHasInvitation(false)->addOption('ru', 'Русский')->addOption('en', 'English');
$this->addElement($element);
$element = new Selectbox('tabNum');
$element->setValue($billingService->getGatewayConfigValue($gwKey, 'tabNum'))->setHasInvitation(false)->addOption('1', 'Electronic Systems')->addOption('2', 'Cash / Bank Transfers')->addOption('3', 'Terminals')->addOption('4', 'SMS payments');
$this->addElement($element);
// submit
$submit = new Submit('save');
$submit->setValue($language->text('billingpayeer', 'btn_save'));
$this->addElement($submit);
}
示例5: index
public function index($params = array())
{
$userService = BOL_UserService::getInstance();
$language = OW::getLanguage();
$this->setPageHeading($language->text('hotlist', 'admin_heading_settings'));
$this->setPageHeadingIconClass('ow_ic_gear_wheel');
$settingsForm = new Form('settingsForm');
$settingsForm->setId('settingsForm');
$expiration_time = new TextField('expiration_time');
$expiration_time->setRequired();
$expiration_time->setLabel($language->text('hotlist', 'label_expiration_time'));
$expiration_time_value = (int) OW::getConfig()->getValue('hotlist', 'expiration_time') / 86400;
$expiration_time->setValue($expiration_time_value);
$settingsForm->addElement($expiration_time);
$submit = new Submit('save');
$submit->addAttribute('class', 'ow_ic_save');
$submit->setValue($language->text('hotlist', 'label_save_btn_label'));
$settingsForm->addElement($submit);
$this->addForm($settingsForm);
if (OW::getRequest()->isPost()) {
if ($settingsForm->isValid($_POST)) {
$data = $settingsForm->getValues();
OW::getConfig()->saveConfig('hotlist', 'expiration_time', $data['expiration_time'] * 86400);
OW::getFeedback()->info($language->text('hotlist', 'settings_saved'));
$this->redirect();
}
}
}
示例6: __construct
public function __construct()
{
parent::__construct('hint-form');
$this->setAjax(TRUE);
$this->setAction(OW::getRouter()->urlForRoute('profileprogressbar.admin_hint'));
$this->setAjaxResetOnSuccess(FALSE);
$this->bindJsFunction('success', 'function(data)
{
$("#profile-progressbar").tipTip({content: data.content});
OW.info("Settings successfully saved");
}');
$checkBox = new CheckboxField('show-hint');
if ((bool) OW::getConfig()->getValue('profileprogressbar', 'show_hint')) {
$checkBox->addAttribute('checked', 'checked');
}
$checkBox->setLabel(OW::getLanguage()->text('profileprogressbar', 'show_hint_label'));
$checkBox->setDescription(OW::getLanguage()->text('profileprogressbar', 'show_hint_desc'));
$this->addElement($checkBox);
$hintText = new WysiwygTextarea('hint-text');
$hintText->setRequired();
$hintText->setSize(WysiwygTextarea::SIZE_L);
$hintText->setValue(OW::getLanguage()->text('profileprogressbar', 'hint_text'));
$hintText->setLabel(OW::getLanguage()->text('profileprogressbar', 'hint_label'));
$hintText->setDescription(OW::getLanguage()->text('profileprogressbar', 'hint_desc'));
$this->addElement($hintText);
$submit = new Submit('save');
$submit->setValue('Save');
$this->addElement($submit);
}
示例7: __construct
public function __construct($providerName)
{
parent::__construct('login-form');
$language = OW::getLanguage();
$this->setAction("");
$label = $language->text('yncontactimporter', 'login_email');
if ($providerName == 'hyves') {
$label = $language->text('yncontactimporter', 'login_username');
}
// email
$email = new TextField('email');
$email->setLabel($label)->setRequired(true);
$this->addElement($email);
//pass
$password = new PasswordField('password');
$password->setLabel($language->text('yncontactimporter', 'login_password'))->setRequired(true);
$this->addElement($password);
//providerName
$hiddenProviderName = new HiddenField('providerName');
$hiddenProviderName->setValue($providerName);
$this->addElement($hiddenProviderName);
// button submit
$submit = new Submit('submit');
$submit->setValue($language->text('yncontactimporter', 'submit_btn_label'));
$this->addElement($submit);
}
示例8: __construct
public function __construct()
{
parent::__construct('AddNewIp');
$submit = new Submit('add');
$submit->setValue(OW::getLanguage()->text('watchdog', 'form_btn_add_white_ip'));
$this->addElement($submit);
}
示例9: settings
public function settings()
{
$adminForm = new Form('adminForm');
$language = OW::getLanguage();
$config = OW::getConfig();
$element = new TextField('autoclick');
$element->setRequired(true);
$validator = new IntValidator(1);
$validator->setErrorMessage($language->text('autoviewmore', 'admin_invalid_number_error'));
$element->addValidator($validator);
$element->setLabel($language->text('autoviewmore', 'admin_auto_click'));
$element->setValue($config->getValue('autoviewmore', 'autoclick'));
$adminForm->addElement($element);
$element = new Submit('saveSettings');
$element->setValue($language->text('autoviewmore', 'admin_save_settings'));
$adminForm->addElement($element);
if (OW::getRequest()->isPost()) {
if ($adminForm->isValid($_POST)) {
$values = $adminForm->getValues();
$config = OW::getConfig();
$config->saveConfig('autoviewmore', 'autoclick', $values['autoclick']);
OW::getFeedback()->info($language->text('autoviewmore', 'user_save_success'));
}
}
$this->addForm($adminForm);
}
示例10: __construct
public function __construct()
{
parent::__construct('bookmarks_settings');
$language = OW::getLanguage();
$this->setAjax();
$this->setAjaxResetOnSuccess(FALSE);
$this->setAction(OW::getRouter()->urlForRoute('bookmarks.admin'));
$this->bindJsFunction('success', 'function()
{
OW.info("' . $language->text('bookmarks', 'settings_saved') . '");
}');
$notifyIntervalConfigVal = OW::getConfig()->getValue('bookmarks', 'notify_interval');
$notifyIntervalVal = array(0 => $language->text('bookmarks', 'remainderinterval_dont_send'), 10 => $language->text('bookmarks', 'remainderinterval_10'), 20 => $language->text('bookmarks', 'remainderinterval_20'), 30 => $language->text('bookmarks', 'remainderinterval_30'));
$notifyInterval = new Selectbox('notify_interval');
$notifyInterval->addValidator(new BookmarkSelectboxValidator($notifyIntervalVal));
$notifyInterval->setOptions($notifyIntervalVal);
$notifyInterval->setValue($notifyIntervalConfigVal);
$notifyInterval->setLabel($language->text('bookmarks', 'notify_interval_label'));
$notifyInterval->setDescription($language->text('bookmarks', 'notify_interval_desc'));
$notifyInterval->setHasInvitation(FALSE);
$this->addElement($notifyInterval);
$submit = new Submit('save');
$submit->setValue($language->text('bookmarks', 'submit_label'));
$this->addElement($submit);
}
示例11: __construct
public function __construct($opponentId)
{
parent::__construct('composeMessageForm');
$this->setEnctype(Form::ENCTYPE_MULTYPART_FORMDATA);
$field = new HiddenField('uid');
$field->setValue(UTIL_HtmlTag::generateAutoId('mailbox_new_message_' . $opponentId));
$this->addElement($field);
$field = new HiddenField('opponentId');
$field->setValue($opponentId);
$this->addElement($field);
$field = new TextField('subject');
$field->setInvitation(OW::getLanguage()->text('mailbox', 'subject'));
$field->setHasInvitation(true);
$field->setRequired();
$this->addElement($field);
$field = new Textarea('message');
$field->setInvitation(OW::getLanguage()->text('mailbox', 'text_message_invitation'));
$field->setHasInvitation(true);
$field->setRequired();
$this->addElement($field);
$field = new HiddenField('attachment');
$this->addElement($field);
$submit = new Submit('sendBtn');
$submit->setId('sendBtn');
$submit->setValue(OW::getLanguage()->text('mailbox', 'add_button'));
$this->addElement($submit);
if (!OW::getRequest()->isAjax()) {
$js = UTIL_JsGenerator::composeJsString('
owForms["composeMessageForm"].bind( "submit", function( r )
{
$("#newmessage-mail-send-btn").addClass("owm_preloader_circle");
});');
OW::getDocument()->addOnloadScript($js);
}
}
示例12: __construct
/**
* Class constructor
*/
public function __construct($providerName)
{
parent::__construct('provider-config-form');
$this->setAjax(true);
$this->bindJsFunction(Form::BIND_SUCCESS, 'function(data){if( data.result ){OW.info(data.message);setTimeout(function(){location.reload();}, 1000);}else{OW.error(data.message);}}');
$this->setAction(OW::getRouter()->urlForRoute('ynsocialconnect-admin-ajaxUpdateProfileQuestion'));
$language = OW::getLanguage();
$service = YNSOCIALCONNECT_BOL_ServicesService::getInstance();
$questionDtoList = $service->getOWQuestionDtoList($providerName);
$aliases = $service->findAliasList($providerName);
$options = $service->getServiceFields($providerName);
foreach ($questionDtoList as $question) {
$new_element = new Selectbox('alias[' . $question->name . ']');
foreach ($options as $option) {
$new_element->addOption($option->name, $option->label);
}
$new_element->setValue(empty($aliases[$question->name]) ? '' : $aliases[$question->name]);
$this->addElement($new_element);
}
$hidden = new TextField('providerName');
$hidden->addAttribute('type', 'hidden');
$hidden->setValue($providerName);
$this->addElement($hidden);
$submit = new Submit('edit');
$submit->setValue($language->text('ynsocialconnect', 'save_btn_label'));
$this->addElement($submit);
}
示例13: index
public function index()
{
$language = OW::getLanguage();
$billingService = BOL_BillingService::getInstance();
$adminForm = new Form('adminForm');
$element = new TextField('creditValue');
$element->setRequired(true);
$element->setLabel($language->text('billingcredits', 'admin_usd_credit_value'));
$element->setDescription($language->text('billingcredits', 'admin_usd_credit_value_desc'));
$element->setValue($billingService->getGatewayConfigValue('billingcredits', 'creditValue'));
$validator = new FloatValidator(0.1);
$validator->setErrorMessage($language->text('billingcredits', 'invalid_numeric_format'));
$element->addValidator($validator);
$adminForm->addElement($element);
$element = new Submit('saveSettings');
$element->setValue($language->text('billingcredits', 'admin_save_settings'));
$adminForm->addElement($element);
if (OW::getRequest()->isPost()) {
if ($adminForm->isValid($_POST)) {
$values = $adminForm->getValues();
$billingService->setGatewayConfigValue('billingcredits', 'creditValue', $values['creditValue']);
OW::getFeedback()->info($language->text('billingcredits', 'user_save_success'));
}
}
$this->addForm($adminForm);
$this->setPageHeading(OW::getLanguage()->text('billingcredits', 'config_page_heading'));
$this->setPageTitle(OW::getLanguage()->text('billingcredits', 'config_page_heading'));
$this->setPageHeadingIconClass('ow_ic_app');
}
示例14: __construct
public function __construct()
{
parent::__construct('set-credits-form');
$this->setAjax(true);
$this->setAction(OW::getRouter()->urlFor('USERCREDITS_CTRL_Ajax', 'setCredits'));
$lang = OW::getLanguage();
$userIdField = new HiddenField('userId');
$userIdField->setRequired(true);
$this->addElement($userIdField);
$balance = new TextField('balance');
$this->addElement($balance);
$submit = new Submit('save');
$submit->setValue($lang->text('base', 'edit_button'));
$this->addElement($submit);
$js = 'owForms["' . $this->getName() . '"].bind("success", function(data){
if ( data.error ){
OW.error(data.error);
}
if ( data.message ) {
OW.info(data.message);
}
_scope.floatBox && _scope.floatBox.close();
_scope.callBack && _scope.callBack(data);
});';
OW::getDocument()->addOnloadScript($js);
}
示例15: __construct
public function __construct()
{
parent::__construct('upload-form');
$language = OW::getLanguage();
$this->setEnctype(Form::ENCTYPE_MULTYPART_FORMDATA);
$fileField = new FileField('photo');
//$fileField->setRequired(true);
$this->addElement($fileField);
// album Field
$albumField = new TextField('album');
$albumField->setRequired(true);
$albumField->setHasInvitation(true);
$albumField->setId('album_input');
$albumField->setInvitation($language->text('photo', 'create_album'));
$this->addElement($albumField);
// description Field
$descField = new Textarea('description');
$descField->setHasInvitation(true);
$descField->setInvitation($language->text('photo', 'describe_photo'));
$this->addElement($descField);
$cancel = new Submit('cancel', false);
$cancel->setValue($language->text('base', 'cancel_button'));
$this->addElement($cancel);
$submit = new Submit('submit', false);
$this->addElement($submit);
}