$invoiceSettings = Civi::settings()->get('contribution_invoice_settings');
$this->assign('invoicing', CRM_Invoicing_Utils::isInvoicingEnabled());
- $this->addElement(
- 'xbutton',
- 'ckeditor_config',
- CRM_Core_Page::crmIcon('fa-wrench') . ' ' . ts('Configure CKEditor'),
- [
- 'type' => 'submit',
- 'class' => 'crm-button',
- 'style' => 'display:inline-block;vertical-align:middle;float:none!important;',
- 'value' => 1,
- ]
- );
+ $this->addElement('submit', 'ckeditor_config', ts('Configure CKEditor'));
$editOptions = CRM_Core_OptionGroup::values('contact_edit_options', FALSE, FALSE, FALSE, 'AND v.filter = 0');
$this->assign('editOptions', $editOptions);
$this->addFormRule(['CRM_Admin_Form_Setting_Smtp', 'formRule']);
parent::buildQuickForm();
$buttons = $this->getElement('buttons')->getElements();
- $buttons[] = $this->createElement(
- 'xbutton',
- $this->_testButtonName,
- CRM_Core_Page::crmIcon('fa-envelope-o') . ' ' . ts('Save & Send Test Email'),
- ['type' => 'submit']
- );
+ $buttons[] = $this->createElement('submit', $this->_testButtonName, ts('Save & Send Test Email'), ['crm-icon' => 'fa-envelope-o']);
$this->getElement('buttons')->setElements($buttons);
if (!empty($setStatus)) {
// add the force save button
$forceSave = $this->getButtonName('upload', 'force');
- $this->addElement('xbutton',
+ $this->addElement('submit',
$forceSave,
- ts('Ignore Mismatch & Process the Batch?'),
- [
- 'type' => 'submit',
- 'value' => 1,
- 'class' => 'crm-button crm-button_qf_Entry_upload_force-save',
- ]
+ ts('Ignore Mismatch & Process the Batch?')
);
$this->addButtons([
['class' => 'crm-select2 crm-action-menu fa-list-ol']
);
}
- $this->addElement('xbutton', $this->getButtonName('next'), ' ', [
- 'class' => 'hiddenElement',
- 'type' => 'submit',
- ]);
+ $this->addElement('submit', $this->getButtonName('next'), ' ', ['class' => 'hiddenElement']);
$this->buildMergeCaseForm();
FALSE,
['class' => 'crm-select2 huge']
);
- $this->addElement('xbutton',
+ $this->addElement('submit',
$this->getButtonName('next', 'merge_case'),
ts('Merge'),
[
'class' => 'hiddenElement',
- 'type' => 'submit',
]
);
}
$this->addField('image_URL', ['maxlength' => '255', 'label' => ts('Browse/Upload Image')]);
// add the dedupe button
- $this->addElement('xbutton',
+ $this->addElement('submit',
$this->_dedupeButtonName,
- ts('Check for Matching Contact(s)'),
- [
- 'type' => 'submit',
- 'value' => 1,
- 'class' => "crm-button crm-button{$this->_dedupeButtonName}",
- ]
+ ts('Check for Matching Contact(s)')
);
- $this->addElement('xbutton',
+ $this->addElement('submit',
$this->_duplicateButtonName,
- ts('Save Matching Contact'),
- [
- 'type' => 'submit',
- 'value' => 1,
- 'class' => "crm-button crm-button{$this->_duplicateButtonName}",
- ]
+ ts('Save Matching Contact')
);
- $this->addElement('xbutton',
+ $this->addElement('submit',
$this->getButtonName('next', 'sharedHouseholdDuplicate'),
- ts('Save With Duplicate Household'),
- [
- 'type' => 'submit',
- 'value' => 1,
- ]
+ ts('Save With Duplicate Household')
);
$buttons = [
// also set the group title and freeze the action task with Add Members to Group
$groupValues = ['id' => $this->_amtgID, 'title' => $this->_group[$this->_amtgID]];
$this->assign_by_ref('group', $groupValues);
- $this->add('xbutton', $this->_actionButtonName, ts('Add Contacts to %1', [1 => $this->_group[$this->_amtgID]]),
+ $this->add('submit', $this->_actionButtonName, ts('Add Contacts to %1', [1 => $this->_group[$this->_amtgID]]),
[
- 'type' => 'submit',
'class' => 'crm-form-submit',
]
);
$this->assign('searchCount', $searchCount);
$this->assign('searchDone', $this->get('searchDone'));
$this->assign('contact_type_display', $contactType);
- $buttonAttrs = [
- 'type' => 'submit',
- 'class' => 'crm-form-submit',
- 'value' => 1,
- ];
- $this->addElement('xbutton', $this->getButtonName('refresh'), ts('Search'), $buttonAttrs);
- $this->addElement('xbutton', $this->getButtonName('cancel'), ts('Cancel'), $buttonAttrs);
+ $this->addElement('submit', $this->getButtonName('refresh'), ts('Search'), ['class' => 'crm-form-submit']);
+ $this->addElement('submit', $this->getButtonName('cancel'), ts('Cancel'), ['class' => 'crm-form-submit']);
$this->addButtons([
[
'type' => 'next',
// views are implemented as frozen form
if ($this->_action & CRM_Core_Action::VIEW) {
$this->freeze();
- $this->addElement('xbutton', 'done', ts('Done'), [
- 'type' => 'button',
- 'onclick' => "location.href='civicrm/admin/custom/group?reset=1&action=browse'",
- ]);
+ $this->addElement('button', 'done', ts('Done'), ['onclick' => "location.href='civicrm/admin/custom/group?reset=1&action=browse'"]);
}
// don't show option for contribution amounts section if membership price set
$this->assign_by_ref('colorFields', $this->_colorFields);
$this->_refreshButtonName = $this->getButtonName('refresh');
- $this->addElement('xbutton',
+ $this->addElement('submit',
$this->_refreshButtonName,
- ts('Save and Preview'),
- ['type' => 'submit']
+ ts('Save and Preview')
);
parent::buildQuickForm();
$this->addFormRule(['CRM_Contribute_Form_ContributionPage_Widget', 'formRule'], $this);
$this->setDefaults(['onDuplicate' => CRM_Import_Parser::DUPLICATE_SKIP]);
- $this->addElement('xbutton', 'loadMapping', ts('Load Mapping'), [
- 'type' => 'submit',
- 'onclick' => 'checkSelect()',
- ]);
+ $this->addElement('submit', 'loadMapping', ts('Load Mapping'), NULL, ['onclick' => 'checkSelect()']);
$this->addContactTypeSelector();
}
$hasRelationTypes = [];
$columnCount = $columnNo;
- $form->addElement('xbutton', 'addBlock', ts('Also include contacts where'),
- [
- 'type' => 'submit',
- 'class' => 'submit-link',
- 'value' => 1,
- ]
+ $form->addElement('submit', 'addBlock', ts('Also include contacts where'),
+ ['class' => 'submit-link']
);
$contactTypes = CRM_Contact_BAO_ContactType::basicTypes();
$form->add('text', "value[$x][$i]", '');
}
- $form->addElement('xbutton', "addMore[$x]", ts('Another search field'), [
- 'type' => 'submit',
- 'class' => 'submit-link',
- 'value' => 1,
- ]);
+ $form->addElement('submit', "addMore[$x]", ts('Another search field'), ['class' => 'submit-link']);
}
//end of block for
$attrs = ['class' => 'crm-form-submit'] + (array) CRM_Utils_Array::value('js', $button);
- // A lot of forms use the hacky method of looking at
- // `$params['button name']` (dating back to them being inputs with a
- // "value" of the button label) rather than looking at
- // `$this->controller->getButtonName()`. It makes sense to give buttons a
- // value by default as a precaution.
- $attrs['value'] = 1;
-
if (!empty($button['class'])) {
$attrs['class'] .= ' ' . $button['class'];
}
}
if ($button['type'] === 'reset') {
- $attrs['type'] = 'reset';
- $prevnext[] = $this->createElement('xbutton', 'reset', $button['name'], $attrs);
+ $prevnext[] = $this->createElement($button['type'], 'reset', $button['name'], $attrs);
}
else {
if (!empty($button['subName'])) {
if (in_array($button['type'], ['next', 'upload', 'done']) && $button['name'] === ts('Save')) {
$attrs['accesskey'] = 'S';
}
- $buttonContents = CRM_Core_Page::crmIcon($button['icon'] ?? $defaultIcon) . ' ' . $button['name'];
+ $icon = CRM_Utils_Array::value('icon', $button, $defaultIcon);
+ if ($icon) {
+ $attrs['crm-icon'] = $icon;
+ }
$buttonName = $this->getButtonName($button['type'], CRM_Utils_Array::value('subName', $button));
- $attrs['class'] .= " crm-button crm-button-type-{$button['type']} crm-button{$buttonName}";
- $attrs['type'] = 'submit';
- $prevnext[] = $this->createElement('xbutton', $buttonName, $buttonContents, $attrs);
+ $prevnext[] = $this->createElement('submit', $buttonName, $button['name'], $attrs);
}
if (!empty($button['isDefault'])) {
$this->setDefaultAction($button['type']);
$this->_actionButtonName = $this->getButtonName('next', 'action');
}
$this->assign('actionButtonName', $this->_actionButtonName);
- $this->add('xbutton', $this->_actionButtonName, ts('Go'), [
- 'type' => 'submit',
- 'class' => 'hiddenElement crm-search-go-button',
- ]);
+ $this->add('submit', $this->_actionButtonName, ts('Go'), ['class' => 'hiddenElement crm-search-go-button']);
// Radio to choose "All items" or "Selected items only"
$selectedRowsRadio = $this->addElement('radio', 'radio_ts', NULL, '', 'ts_sel', ['checked' => 'checked']);
if ($this->_action & CRM_Core_Action::VIEW) {
$this->freeze();
$url = CRM_Utils_System::url('civicrm/admin/custom/group/field', 'reset=1&action=browse&gid=' . $this->_gid);
- $this->addElement('xbutton',
+ $this->addElement('button',
'done',
ts('Done'),
- [
- 'type' => 'button',
- 'onclick' => "location.href='$url'",
- ]
+ ['onclick' => "location.href='$url'"]
);
}
}
// TODO: Is this condition ever true? Can this code be removed?
if ($this->_action & CRM_Core_Action::VIEW) {
$this->freeze();
- $this->addElement('xbutton', 'done', ts('Done'), [
- 'type' => 'button',
- 'onclick' => "location.href='civicrm/admin/custom/group?reset=1&action=browse'",
- ]);
+ $this->addElement('button', 'done', ts('Done'), ['onclick' => "location.href='civicrm/admin/custom/group?reset=1&action=browse'"]);
}
}
'reset=1&action=browse&fid=' . $this->_fid . '&gid=' . $this->_gid,
TRUE, NULL, FALSE
);
- $this->addElement('xbutton',
+ $this->addElement('button',
'done',
- CRM_Core_Page::crmIcon('fa-times') . ' ' . ts('Done'),
- [
- 'type' => 'button',
- 'onclick' => "location.href='$url'",
- 'class' => 'crm-form-submit cancel',
- ]
+ ts('Done'),
+ ['onclick' => "location.href='$url'", 'class' => 'crm-form-submit cancel', 'crm-icon' => 'fa-times']
);
}
}
$this->add('datepicker', 'discount_end_date[' . $i . ']', ts('Discount End Date'), [], FALSE, ['time' => FALSE]);
}
$_showHide->addToTemplate();
- $this->addElement('xbutton', $this->getButtonName('submit'), ts('Add Discount Set to Fee Table'),
- [
- 'type' => 'submit',
- 'class' => 'crm-form-submit cancel',
- 'value' => 1,
- ]
+ $this->addElement('submit', $this->getButtonName('submit'), ts('Add Discount Set to Fee Table'),
+ ['class' => 'crm-form-submit cancel']
);
if (Civi::settings()->get('deferred_revenue_enabled')) {
$deferredFinancialType = CRM_Financial_BAO_FinancialAccount::getDeferredFinancialType();
*/
public function buildQuickForm() {
if ($this->_batchStatus == 'Closed') {
- $this->add('xbutton', 'export_batch', ts('Export Batch'), ['type' => 'submit']);
+ $this->add('submit', 'export_batch', ts('Export Batch'));
}
// do not build rest of form unless it is open/reopened batch
parent::buildQuickForm();
if (CRM_Batch_BAO_Batch::checkBatchPermission('close', $this->_values['created_id'])) {
- $this->add('xbutton', 'close_batch', ts('Close Batch'), ['type' => 'submit']);
+ $this->add('submit', 'close_batch', ts('Close Batch'));
if (CRM_Batch_BAO_Batch::checkBatchPermission('export', $this->_values['created_id'])) {
- $this->add('xbutton', 'export_batch', ts('Close & Export Batch'), ['type' => 'submit']);
+ $this->add('submit', 'export_batch', ts('Close & Export Batch'));
}
}
ts('Task'),
['' => ts('- actions -')] + ['Remove' => ts('Remove from Batch')]);
- $this->add('xbutton', 'rSubmit', ts('Go'),
+ $this->add('submit', 'rSubmit', ts('Go'),
[
- 'type' => 'submit',
'class' => 'crm-form-submit',
'id' => 'GoRemove',
]);
ts('Task'),
['' => ts('- actions -')] + ['Assign' => ts('Assign to Batch')]);
- $this->add('xbutton', 'submit', ts('Go'),
+ $this->add('submit', 'submit', ts('Go'),
[
- 'type' => 'submit',
'class' => 'crm-form-submit',
'id' => 'Go',
]);
ts('Task'),
['' => ts('- actions -')] + $batchAction);
- $this->add('xbutton', 'submit', ts('Go'),
+ $this->add('submit', 'submit', ts('Go'),
[
- 'type' => 'submit',
'class' => 'crm-form-submit',
'id' => 'Go',
]);
if ($this->_action & CRM_Core_Action::VIEW) {
$this->freeze();
$url = CRM_Utils_System::url('civicrm/admin/price/field', 'reset=1&action=browse&sid=' . $this->_sid);
- $this->addElement('xbutton',
+ $this->addElement('button',
'done',
ts('Done'),
- [
- 'type' => 'button',
- 'onclick' => "location.href='$url'",
- ]
+ ['onclick' => "location.href='$url'"]
);
}
}
if ($this->_context == 'dialog') {
$this->addElement(
- 'xbutton',
+ 'submit',
$this->_duplicateButtonName,
- ts('Save Matching Contact'),
- [
- 'type' => 'submit',
- 'class' => 'crm-button',
- ]
+ ts('Save Matching Contact')
);
}
}
if (($this->_multiRecord & CRM_Core_Action::DELETE) && $this->_recordExists) {
$this->_deleteButtonName = $this->getButtonName('upload', 'delete');
- $this->addElement('xbutton', $this->_deleteButtonName, ts('Delete'), [
- 'type' => 'submit',
- 'value' => 1,
- 'class' => 'crm-button',
- ]);
+ $this->addElement('submit', $this->_deleteButtonName, ts('Delete'));
return;
}
if (!empty($this->_charts)) {
$this->addElement('select', "charts", ts('Chart'), $this->_charts);
$this->assign('charts', $this->_charts);
- $this->addElement('xbutton', $this->_chartButtonName, ts('View'), ['type' => 'submit']);
+ $this->addElement('submit', $this->_chartButtonName, ts('View'));
}
}
$this->assign('group', TRUE);
}
- $this->addElement('xbutton', $this->_groupButtonName, '', [
- 'type' => 'submit',
- 'style' => 'display: none;',
- ]);
+ $this->addElement('submit', $this->_groupButtonName, '', ['style' => 'display: none;']);
$this->addChartOptions();
$showResultsLabel = $this->getResultsLabel();
// if view mode pls freeze it with the done button.
if ($this->_action & CRM_Core_Action::VIEW) {
$this->freeze();
- $this->addElement('xbutton', 'done', ts('Done'),
- [
- 'type' => 'button',
- 'onclick' => "location.href='civicrm/admin/uf/group/field?reset=1&action=browse&gid=" . $this->_gid . "'",
- ]
+ $this->addElement('button', 'done', ts('Done'),
+ ['onclick' => "location.href='civicrm/admin/uf/group/field?reset=1&action=browse&gid=" . $this->_gid . "'"]
);
}
// views are implemented as frozen form
if ($this->_action & CRM_Core_Action::VIEW) {
$this->freeze();
- $this->addElement('xbutton', 'done', ts('Done'), [
- 'type' => 'button',
- 'onclick' => "location.href='civicrm/admin/uf/group?reset=1&action=browse'",
- ]);
+ $this->addElement('button', 'done', ts('Done'), ['onclick' => "location.href='civicrm/admin/uf/group?reset=1&action=browse'"]);
}
$this->addFormRule(['CRM_UF_Form_Group', 'formRule'], $this);
cursor: pointer;
}
-#crm-container button.submit-link {
+#crm-container input.submit-link {
color: #285286;
background: none transparent;
border: none;
margin-left: .5em;
}
+.crm-container .crm-button input {
+ background: none;
+ border: medium none;
+ color: #FFF;
+ cursor: pointer;
+ font-size: 13px;
+ font-weight: normal;
+ margin: 0;
+ padding: 1px 8px 2px 4px;
+}
+
.crm-container .crm-button-type-cancel,
.crm-container .crm-button-type-back {
margin-left: 20px;
.crm-container a.button,
.crm-container a.button:link,
.crm-container a.button:visited,
+.crm-container input.crm-form-submit,
.crm-container .ui-dialog-buttonset .ui-button,
+.crm-container input[type=button],
.crm-container .crm-button {
text-shadow: 0 1px 0 black;
background: #696969;
text-decoration: none;
cursor: pointer;
border: 1px solid #3e3e3e;
+}
+
+.crm-container a.button,
+.crm-container a.button:link,
+.crm-container a.button:visited,
+.crm-container span.crm-button {
display: block;
float: left;
overflow: hidden;
line-height: 135%;
- border-radius: 3px;
+}
+
+/* Preserving the important but not sure why */
+.crm-container span.crm-button {
+ float: left !important;
+}
+
+.crm-container button.crm-button {
+ padding: 3px 6px;
+}
+
+.crm-container button.crm-button .icon {
+ margin-bottom: -4px;
+}
+
+.crm-container input.crm-form-submit,
+.crm-container input[type=button] {
+ padding: 2px 6px;
+}
+
+.crm-container .crm-button input[type=button],
+.crm-container .crm-button input.crm-form-submit {
+ padding: 0;
+ margin: 0;
+ background: none;
+ border: none;
}
.crm-container .crm-button:hover,
.crm-container .crm-button:focus,
+.crm-container input[type=submit]:hover,
+.crm-container input[type=button]:hover,
.crm-container .ui-dialog-buttonset .ui-button:hover,
.crm-container .ui-dialog-buttonset .ui-button:focus,
.crm-container a.button:hover,
.crm-container .crm-button-disabled,
.crm-container .crm-button.crm-button-disabled,
.crm-container .ui-dialog-buttonset .ui-button[disabled],
+.crm-container input.crm-form-submit[disabled],
+.crm-container input[type=button][disabled],
.crm-container .crm-button[disabled] {
opacity: .6;
cursor: default;
}
+.crm-container .crm-button-disabled input[disabled] {
+ opacity: 1;
+}
+
.crm-container .ui-dialog-buttonpane {
background: linear-gradient(to bottom, #f2f2f2 0%,#ffffff 35%);
}
+.crm-container .ui-dialog-buttonset .ui-button {
+ padding: 0;
+}
.crm-container .ui-dialog-buttonset .ui-button .ui-icon {
background-image: url("../i/icons/jquery-ui-FFFFFF.png");
}
-/* Override of a line in crm-i.css that may not be important anymore */
-.crm-container .ui-dialog-buttonset .ui-button .ui-icon[class*=" fa-"] {
- margin-top: 0;
-}
-
/* No crm-button styling for PayPal Express buttons */
.crm-container input#_qf_Register_upload_express,
.crm-container input#_qf_Payment_upload_express,
}
/* rounded corners */
+.crm-container .crm-button,
+.crm-container a.button,
+.crm-container a.button:link,
+.crm-container input.crm-form-submit,
+.crm-container input[type=button] {
+ border-radius: 3px;
+}
+
+
.crm-container div.status,
.crm-container #help,
.crm-container .help,
.crm-container input {
height: auto;
}
-.crm-container button[type=submit] {
+.crm-container input[type=submit] {
height: auto;
}
}
/* Remove Joomla subhead toolbar & whitespace border */
-
+
body.admin.com_civicrm .subhead-collapse {
display:none;
}
<?php } ?>
<p>
- <button id="install_button" type="submit" name="go" onclick="document.getElementById('saving_top').style.display = ''; this.innerHTML = '<?php echo ts('Installing CiviCRM...', ['escape' => 'js']); ?>'"><?php echo ts('Check Requirements and Install CiviCRM', ['escape' => 'js']); ?></button>
+ <input id="install_button" type="submit" name="go" value="<?php echo ts('Check Requirements and Install CiviCRM', array('escape' => 'js')); ?>" onclick="document.getElementById('saving_top').style.display = ''; this.value = '<?php echo ts('Installing CiviCRM...', array('escape' => 'js')); ?>'" />
<span id="saving_top" style="display: none">
?>
</select>
<noscript>
- <button type="submit" name="setlanguage"><?php echo ts('Change language', ['escape' => 'js']); ?></button>
+ <input type="submit" name="setlanguage" value="<?php echo ts('Change language', array('escape' => 'js')); ?>" />
</noscript>
<span class="testResults">
<?php
<span class="testResults">Check this box to pre-populate CiviCRM with sample English contact records, online contribution pages, profile forms, etc. These examples can help you learn about CiviCRM features.</span><br />
</p>
-<p style="margin-left: 2em"><button type="submit"><?php echo ts('Re-check requirements', ['escape' => 'js']); ?></button></p>
+<p style="margin-left: 2em"><input type="submit" value="<?php echo ts('Re-check requirements', array('escape' => 'js')); ?>" /></p>
<a name="dbDetails">
}
var submitcount = 0;
+/**
+ * Old submit-once function. Will be removed soon.
+ * @deprecated
+ */
+function submitOnce(obj, formId, procText) {
+ // if named button clicked, change text
+ if (obj.value != null) {
+ cj('input[name=' + obj.name + ']').val(procText + " ...");
+ }
+ cj(obj).closest('form').attr('data-warn-changes', 'false');
+ if (document.getElementById) { // disable submit button for newer browsers
+ cj('input[name=' + obj.name + ']').attr("disabled", true);
+ document.getElementById(formId).submit();
+ return true;
+ }
+ else { // for older browsers
+ if (submitcount == 0) {
+ submitcount++;
+ return true;
+ }
+ else {
+ alert("Your request is currently being processed ... Please wait.");
+ return false;
+ }
+ }
+}
/**
* Function to show / hide the row in optionFields
$.propHooks.disabled = {
set: function (el, value, name) {
// Sync button enabled status with wrapper css
- if ($(el).is('.crm-button.crm-form-submit')) {
+ if ($(el).is('span.crm-button > input.crm-form-submit')) {
$(el).parent().toggleClass('crm-button-disabled', !!value);
}
// Sync button enabled status with dialog button
$('form[data-submit-once]', e.target)
.submit(submitOnceForm)
.on('invalid-form', submitFormInvalid);
- $('form[data-submit-once] button[type=submit]', e.target).click(function(e) {
+ $('form[data-submit-once] input[type=submit]', e.target).click(function(e) {
submitButton = e.target;
});
})
var buttonContainers = '.crm-submit-buttons, .action-link',
buttons = [],
added = [];
- $(buttonContainers, $el).find('.crm-form-submit, .crm-form-xbutton, a.button, button').each(function() {
+ $(buttonContainers, $el).find('input.crm-form-submit, a.button, button').each(function() {
var $el = $(this),
label = $el.is('input') ? $el.attr('value') : $el.text(),
identifier = $el.attr('name') || $el.attr('href');
$el.dialog('option', 'buttons', buttons);
}
// Allow a button to prevent ajax submit
- $('input[data-no-ajax-submit=true], button[data-no-ajax-submit=true]').click(function() {
+ $('input[data-no-ajax-submit=true]').click(function() {
$(this).closest('form').ajaxFormUnbind();
});
// For convenience, focus the first field
// When selecting a task
.on('change', 'select#task', function(e) {
var $form = $(this).closest('form'),
- $go = $('button.crm-search-go-button', $form);
+ $go = $('input.crm-search-go-button', $form);
var $selectedOption = $(this).find(':selected');
if (!$selectedOption.val()) {
// do not blank refresh the empty option.
html += '<form class="widget-settings">';
html += ' <div class="widget-settings-inner"></div>';
html += ' <div class="widget-settings-buttons">';
- html += ' <button id="' + widget.id + '-settings-save" class="widget-settings-save" type="submit">Save</button>';
- html += ' <button id="' + widget.id + '-settings-cancel" class="widget-settings-cancel" type="submit">Cancel</button>';
+ html += ' <input id="' + widget.id + '-settings-save" class="widget-settings-save" value="Save" type="submit" />';
+ html += ' <input id="' + widget.id + '-settings-cancel" class="widget-settings-cancel" value="Cancel" type="submit" />';
html += ' </div>';
html += '</form>';
return html;
<div>
<input type="text" name="civisetup[advanced][db]" value="<?php echo htmlentities($model->extras['advanced']['db']); ?>" data-original="<?php echo htmlentities($model->extras['advanced']['db']); ?>">
- <button id="db_apply_button" type="submit" name="civisetup[action][Start]"><?php echo htmlentities(ts('Apply')); ?></button>
+ <input id="db_apply_button" type="submit" name="civisetup[action][Start]" value="<?php echo htmlentities(ts('Apply')); ?>" />
<a href="" onclick="civisetupAdvancedDbCancel(); return false;" title="<?php echo htmlentities(ts('Cancel')) ?>"><i class="fa fa-close"></i></a>
<script type="text/javascript">
function civisetupAdvancedDbCancel() {
<?php if (!defined('CIVI_SETUP')): exit("Installation plugins must only be loaded by the installer.\n");
endif; ?>
<div class="action-box">
- <button id="install_button" type="submit" name="civisetup[action][Install]"
- onclick="document.getElementById('saving_top').style.display = ''; this.innerHTML = '<?php echo ts('Installing CiviCRM...', array('escape' => 'js')); ?>'"><?php echo htmlentities(ts('Install CiviCRM')); ?></button>
+ <input id="install_button" type="submit" name="civisetup[action][Install]"
+ value="<?php echo htmlentities(ts('Install CiviCRM')); ?>"
+ onclick="document.getElementById('saving_top').style.display = ''; this.value = '<?php echo ts('Installing CiviCRM...', array('escape' => 'js')); ?>'"/>
<div id="saving_top" style="display: none;">
<img src="<?php echo htmlentities($installURLPath . "network-save.gif") ?>"/>
<?php echo ts('(this will take a few minutes)'); ?>
</table>
<div class="action-box">
- <button id="recheck_button" type="submit" name="civisetup[action][Start]"><?php echo htmlentities(ts('Refresh')); ?></button>
+ <input id="recheck_button" type="submit" name="civisetup[action][Start]" value="<?php echo htmlentities(ts('Refresh')); ?>" />
<div class="advancedTip">
<?php echo ts('After updating your system, refresh to test the requirements again.'); ?>
</div>
float: left;
margin-left: 10%;
margin-top: 50px;
- margin-right: 20%;
+ margin-right: 20%;
display: inline-flex;
}
100% { left: 0; color: #555;}
}
-
+
.civicrm-setup-header hr{
border-bottom: 2px solid #fff;
border-top: 2px solid #ddd;
text-align: center;
margin: 2em 0.5em;
}
-.civicrm-setup-body button[type=submit] {
+.civicrm-setup-body input[type=submit] {
padding:15px 25px;
background:#82C459;
color: white;
border-radius: 5px;
font-size: 20px;
}
-.civicrm-setup-body button[type=submit]:hover {
+.civicrm-setup-body input[type=submit]:hover {
background: #60A237;
}
-.civicrm-setup-body button[type=submit]:disabled {
+.civicrm-setup-body input[type=submit]:disabled {
background: #888;
cursor: not-allowed;
}
width: 95%;
}
}
+
*
* @param array $fields
* HTTP inputs -- e.g. with a form element like this:
- * `<button type="submit" name="civisetup[action][Foo]">Do the foo</button>`
+ * `<input type="submit" name="civisetup[action][Foo]" value="Do the foo">`
* @param string $default
* The action-name to return if no other action is identified.
* @return string
<td>
{$form.editor_id.html}
- {$form.ckeditor_config.html}
+ <span class="crm-button" style="display:inline-block;vertical-align:middle;float:none!important;">
+ <i class="crm-i fa-wrench" aria-hidden="true"></i>
+ {$form.ckeditor_config.html}
+ </span>
</td>
</tr>
<tr class="crm-preferences-display-form-block-ajaxPopupsEnabled">
</table>
</div>
<div class="crm-submit-buttons">
- <button type="submit" class="crm-button crm-form-submit" accesskey="S" title="{ts}Execute API call and display results{/ts}">
- <i class="crm-i fa-bolt" aria-hidden="true"></i> {ts}Execute{/ts}
- </button>
+ <span class="crm-button">
+ <i class="crm-i fa-bolt" aria-hidden="true"></i> <input type="submit" value="{ts}Execute{/ts}" class="crm-form-submit" accesskey="S" title="{ts}Execute API call and display results{/ts}"/>
+ </span>
</div>
<pre id="api-result" class="linenums">
</div>
<div class="crm-submit-buttons">
- <button type="submit" name="save" class="crm-form-submit crm-button" accesskey="S">
- <i class="crm-i fa-wrench" aria-hidden="true"></i> {ts}Save{/ts}
- </button>
- <button type="submit" name="revert" class="crm-form-submit crm-button" onclick="return confirm('{$revertConfirm}');">
- <i class="crm-i fa-times" aria-hidden="true"></i> {ts}Revert to Default{/ts}
- </button>
+ <span class="crm-button">
+ <i class="crm-i fa-wrench" aria-hidden="true"></i> <input type="submit" value="{ts}Save{/ts}" name="save" class="crm-form-submit" accesskey="S"/>
+ </span>
+ <span class="crm-button">
+ <i class="crm-i fa-times" aria-hidden="true"></i> <input type="submit" value="{ts}Revert to Default{/ts}" name="revert" class="crm-form-submit" onclick="return confirm('{$revertConfirm}');"/>
+ </span>
</div>
<input type="hidden" value="{$preset}" name="preset" />
</fieldset>
<div class="status message status-warning">
<i class="crm-i fa-exclamation-triangle" aria-hidden="true"></i> {ts}Total for amounts entered below does not match the expected batch total.{/ts}
</div>
- {$form._qf_Entry_upload_force.html}
+ <span class="crm-button crm-button_qf_Entry_upload_force-save">
+ {$form._qf_Entry_upload_force.html}
+ </span>
<div class="clear"></div>
{/if}
<table class="form-layout-compressed batch-totals">
<input type="hidden" name="qfKey" value="{crmKey name='CRM_Contact_Form_Contact' addSequence=1}" />
</div>
-<div class="form-item"><button type="submit" name="_qf_Contact_next" class="crm-button crm-form-submit">{ts}Save{/ts}</button></div>
+<div class="form-item"><input type="submit" name="_qf_Contact_next" value="{ts}Save{/ts}" class="crm-form-submit" /></div>
</form>
</div>
<div class="block-crm crm-container">
<form method="post" id="id_fulltext_search">
<div style="margin-bottom: 8px;">
- <input type="text" name="text" id='text' value="" class="crm-form-text" style="width: 10em;" /> <button type="submit" name="submit" id="fulltext_submit" class="crm-button crm-form-submit" onclick='submitForm();'>{ts}Go{/ts}</button>
+ <input type="text" name="text" id='text' value="" class="crm-form-text" style="width: 10em;" /> <input type="submit" name="submit" id="fulltext_submit" value="{ts}Go{/ts}" class="crm-form-submit"/ onclick='submitForm();'>
<input type="hidden" name="qfKey" value="{crmKey name='CRM_Contact_Controller_Search' addSequence=1}" />
</div>
<select class="form-select" id="fulltext_table" name="fulltext_table">
</table>
{*add dupe buttons *}
- {$form._qf_Contact_refresh_dedupe.html}
+ <span class="crm-button crm-button_qf_Contact_refresh_dedupe">
+ {$form._qf_Contact_refresh_dedupe.html}
+ </span>
{if $isDuplicate}
- {$form._qf_Contact_upload_duplicate.html}
+ <span class="crm-button crm-button_qf_Contact_upload_duplicate">
+ {$form._qf_Contact_upload_duplicate.html}
+ </span>
{/if}
<div class="spacer"></div>
</div>
loadMultiRecordFields();
{/literal}{if $oldSubtypes}{literal}
- $('button[name=_qf_Contact_upload_view], button[name=_qf_Contact_upload_new]').click(function() {
+ $('input[name=_qf_Contact_upload_view], input[name=_qf_Contact_upload_new]').click(function() {
var submittedSubtypes = $('#contact_sub_type').val();
var oldSubtypes = {/literal}{$oldSubtypes}{literal};
})
// Add new field - if there's a hidden one, show it
// Otherwise allow form to submit and fetch more from the server
- .on('click', 'button[name^=addMore]', function() {
+ .on('click', 'input[name^=addMore]', function() {
var table = $(this).closest('table');
if ($('tr:hidden', table).length) {
$('tr:hidden', table).first().show();
{/literal}
<form action="{crmURL p='civicrm/contact/view' q="cid=`$contactId`&reset=1"}" method="post" id="Print1" >
<div class="form-item">
- <span class="element-right"><button onclick="window.print(); return false" class="crm-button crm-form-submit default" name="_qf_Print_next" type="submit">{ts}Print{/ts}</button> <button class="crm-button crm-form-submit" name="_qf_Print_back" type="submit">{ts}Done{/ts}</button></span>
+ <span class="element-right"><input onclick="window.print(); return false" class="crm-form-submit default" name="_qf_Print_next" value="{ts}Print{/ts}" type="submit" /> <input class="crm-form-submit" name="_qf_Print_back" value="{ts}Done{/ts}" type="submit" /></span>
</div>
</form>
<br />
<div class="premium-full-title">{$row.name}</div>
<div class="premium-full-disabled">
{ts 1=$row.min_contribution|crmMoney}You must contribute at least %1 to get this item{/ts}<br/>
- <button type="button" value="{ts 1=$row.min_contribution|crmMoney}Contribute %1 Instead{/ts}" amount="{$row.min_contribution}" />
+ <input type="button" value="{ts 1=$row.min_contribution|crmMoney}Contribute %1 Instead{/ts}" amount="{$row.min_contribution}" />
</div>
<div class="premium-full-description">
{$row.description}
amounts.sort(function(a,b){return a - b});
// make contribution instead buttons work
- $('.premium-full-disabled button').click(function(){
+ $('.premium-full-disabled input').click(function(){
var amount = Number($(this).attr('amount'));
if (price_sets[amount]) {
if (!$(price_sets[amount]).length) {
{/literal}
{/if}
{/if}
+
<script type="text/javascript">
{literal} (function($, _) { // Generic Closure
- $(".crm-submit-buttons button").click( function() {
+ $(".crm-submit-buttons input").click( function() {
$(".dedupenotify .ui-notify-close").click();
});
<script type="text/javascript">
var totalPages = {/literal}{$pager->_totalPages}{literal};
CRM.$(function($) {
- $("#crm-container .crm-pager button.crm-form-submit").click(function () {
+ $("#crm-container .crm-pager input.crm-form-submit").click(function () {
submitPagerData(this);
});
});
{ts 1=$display_name 2=$email}Are you sure you want to resubscribe: %1 (%2){/ts}
<br/>
<center>
-<button type="submit" name="_qf_resubscribe_next" class="crm-button crm-form-submit">{ts}Resubscribe{/ts}</button>
+<input type="submit" name="_qf_resubscribe_next" value="{ts}Resubscribe{/ts}" class="crm-form-submit" />
-<button type="submit" name="_qf_resubscribe_cancel" class="crm-button crm-form-submit">{ts}Cancel{/ts}</button>
+<input type="submit" name="_qf_resubscribe_cancel" value="{ts}Cancel{/ts}" class="crm-form-submit" />
</center>
</form>
</div>
</div>
<div class="crm-submit-buttons">
- {$form._qf_Edit_upload_delete.html}
+ <span class="crm-button">{$form._qf_Edit_upload_delete.html}</span>
{if $includeCancelButton}
<a class="button cancel" href="{$cancelURL}">{$cancelButtonText}</a>
{/if}
{if $isDuplicate and ( ($action eq 1 and $mode eq 4 ) or ($action eq 2) or ($action eq 8192) ) }
<div class="crm-submit-buttons">
- {$form._qf_Edit_upload_duplicate.html}
+ <span class="crm-button">{$form._qf_Edit_upload_duplicate.html}</span>
</div>
{/if}
{if $mode eq 1 || $activeComponent neq "CiviCRM"}
{if $action eq 2 and $multiRecordFieldListing}
<h1>{ts}Edit Details{/ts}</h1>
<div class="crm-submit-buttons" style='float:right'>
- {include file="CRM/common/formButtons.tpl"}{if $isDuplicate}{$form._qf_Edit_upload_duplicate.html}{/if}
+ {include file="CRM/common/formButtons.tpl"}{if $isDuplicate}<span class="crm-button">{$form._qf_Edit_upload_duplicate.html}</span>{/if}
</div>
{/if}
</div>
{/if}
<div class="crm-submit-buttons" style='{$floatStyle}'>
- {include file="CRM/common/formButtons.tpl"}{if $isDuplicate}{$form._qf_Edit_upload_duplicate.html}{/if}
+ {include file="CRM/common/formButtons.tpl"}{if $isDuplicate}<span class="crm-button">{$form._qf_Edit_upload_duplicate.html}</span>{/if}
{if $includeCancelButton}
<a class="button cancel" href="{$cancelURL}">
<span>
createChart( chartID, divName, chartValues.size.xSize, chartValues.size.ySize, allData[chartID].object );
});
- // FIXME
$("input[id$='submit_print'],input[id$='submit_pdf']").bind('click', function(e){
// image creator php file path and append image name
var url = CRM.url('civicrm/report/chart', 'name=' + '{/literal}{$chartId}{literal}' + '.png');
params.autoClose = params.openInline = params.cancelButton = params.refreshAction = false;
ui.panel.on('crmFormLoad', function() {
// Hack: "Save and done" and "Cancel" buttons submit without ajax
- $('.cancel.crm-form-submit, button[name$=upload_done]', this).on('click', function(e) {
+ $('.cancel.crm-form-submit, input[name$=upload_done]', this).on('click', function(e) {
$(this).closest('form').ajaxFormUnbind();
});
});
{literal}
<script type="text/javascript">
CRM.$(function($) {
- var more = $('.crm-button.validate').click(function(e) {
+ var more = $('.crm-button input.validate').click(function(e) {
var message = "{/literal} {if $context eq 'Event'}
{ts escape='js'}Note: Revenue for this event registration will not be deferred as the financial type does not have a deferred revenue account setup for it. If you want the revenue to be deferred, please select a different Financial Type with a Deferred Revenue account setup for it, or setup a Deferred Revenue account for this Financial Type.{/ts}
{else if $context eq 'MembershipType'}
{/foreach}
{/if}
+{* Loops through $form.buttons.html array and assigns separate spans with classes to allow theming by button and name.
+ * crmBtnType grabs type keyword from button name (e.g. 'upload', 'next', 'back', 'cancel') so types of buttons can be styled differently via css.
+ *}
{foreach from=$form.buttons item=button key=key name=btns}
{if $key|substring:0:4 EQ '_qf_'}
{if $location}
- {$form.buttons.$key.html|crmReplace:id:"$key-$location"}
+ {assign var='html' value=$form.buttons.$key.html|crmReplace:id:"$key-$location"}
{else}
- {$form.buttons.$key.html}
+ {assign var='html' value=$form.buttons.$key.html}
{/if}
+ {crmGetAttribute html=$html attr='crm-icon' assign='icon'}
+ {capture assign=iconPrefix}{$icon|truncate:3:"":true}{/capture}
+ {if $icon && $iconPrefix eq 'fa-'}
+ {capture assign=iconDisp}<i class="crm-i {$icon}" aria-hidden="true"></i>{/capture}
+ {/if}
+ {crmGetAttribute html=$html attr='disabled' assign='disabled'}
+ <span class="crm-button crm-button-type-{$key|crmBtnType} crm-button{$key}{if $disabled} crm-button-disabled{/if}"{if $buttonStyle} style="{$buttonStyle}"{/if}>
+ {$iconDisp}
+ {$html}
+ </span>
{/if}
{/foreach}
{/crmRegion}
<input type="hidden" name="hidden_location" value="1" />
<input type="hidden" name="hidden_custom" value="1" />
<input type="hidden" name="qfKey" value="" />
- <div style="height:1px; overflow:hidden;"><button type="submit" name="_qf_Advanced_refresh" class="crm-button crm-form-submit default">{ts}Go{/ts}</button></div>
+ <div style="height:1px; overflow:hidden;"><input type="submit" value="{ts}Go{/ts}" name="_qf_Advanced_refresh" class="crm-form-submit default" /></div>
</div>
</form>
<ul>