本文整理汇总了PHP中Submit类的典型用法代码示例。如果您正苦于以下问题:PHP Submit类的具体用法?PHP Submit怎么用?PHP Submit使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Submit类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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');
}
示例2: 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);
}
示例3: __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);
}
示例4: __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);
}
示例5: __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);
}
示例6: __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);
}
示例7: __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);
}
}
示例8: __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);
}
示例9: __construct
/**
* Class constructor
*
*/
public function __construct($plugins)
{
parent::__construct('configForm');
$language = OW::getLanguage();
$values = OW::getConfig()->getValues('attachments');
if ($plugins['video']) {
$field = new CheckboxField('video_share');
$field->setValue($values['video_share']);
$this->addElement($field);
}
if ($plugins['links']) {
$field = new CheckboxField('link_share');
$field->setValue($values['link_share']);
$this->addElement($field);
}
if ($plugins['photo']) {
$field = new CheckboxField('photo_share');
$field->setId('photo_share_check');
$field->setValue($values['photo_share']);
$this->addElement($field);
$field = new TextField('photo_album_name');
$field->setValue(OW::getLanguage()->text('attachments', 'default_photo_album_name'));
$field->setRequired();
$this->addElement($field);
}
// submit
$submit = new Submit('save');
$submit->setValue($language->text('attachments', 'config_save_label'));
$this->addElement($submit);
}
示例10: __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);
}
示例11: testCompile
public function testCompile()
{
$field = new Submit("test", "Test");
$expected = "<input type=\"submit\" name=\"test\" value=\"Test\" />";
$value = $field->compile();
$this->assertEquals($expected, $value);
}
示例12: __construct
public function __construct()
{
parent::__construct('settingsForm');
$themes = new Selectbox('themeList');
$themes->setRequired();
$themes->setLabel(OW::getLanguage()->text('profileprogressbar', 'theme_label'));
$plugin = OW::getPluginManager()->getPlugin('profileprogressbar');
$dirIterator = new RecursiveDirectoryIterator($plugin->getStaticDir() . 'css' . DS);
$interator = new RecursiveIteratorIterator($dirIterator);
$themesList = array();
foreach ($interator as $file) {
if ($file->getFilename() == '.') {
continue;
}
if (!$file->isDir() && pathinfo($file->getPathname(), PATHINFO_EXTENSION) == 'css') {
$themeName = substr($file->getFilename(), 0, strrpos($file->getFilename(), '.'));
if (file_exists($plugin->getStaticDir() . 'img' . DS . $themeName . DS . 'background.png') && file_exists($plugin->getStaticDir() . 'img' . DS . $themeName . DS . 'complete.png')) {
$themesList[$themeName] = ucfirst($themeName);
}
}
}
asort($themesList);
$themes->setOptions($themesList);
$themes->setValue(OW::getConfig()->getValue('profileprogressbar', 'theme'));
$this->addElement($themes);
$validator = new SelectboxValidator($themesList);
$themes->addValidator($validator);
$submit = new Submit('save');
$submit->setValue(OW::getLanguage()->text('profileprogressbar', 'save_settings'));
$this->addElement($submit);
}
示例13: __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);
}
示例14: index
public function index()
{
$groups = MODERATION_BOL_Service::getInstance()->getContentGroups();
if (OW::getRequest()->isPost()) {
$selectedGroups = empty($_POST["groups"]) ? array() : $_POST["groups"];
$types = array();
foreach ($groups as $group) {
$selected = in_array($group["name"], $selectedGroups);
foreach ($group["entityTypes"] as $type) {
$types[$type] = $selected;
}
}
OW::getConfig()->saveConfig("moderation", "content_types", json_encode($types));
OW::getFeedback()->info(OW::getLanguage()->text("moderation", "content_types_saved_message"));
$this->redirect(OW::getRouter()->urlForRoute("moderation.admin"));
}
$this->setPageHeading(OW::getLanguage()->text("moderation", "admin_heading"));
$this->setPageTitle(OW::getLanguage()->text("moderation", "admin_title"));
$form = new Form("contentTypes");
$submit = new Submit("save");
$submit->setLabel(OW::getLanguage()->text("admin", "save_btn_label"));
$form->addElement($submit);
$this->addForm($form);
$this->assign("groups", $groups);
}
示例15: __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);
}