$invoiceSettings = Civi::settings()->get('contribution_invoice_settings');
$this->assign('invoicing', CRM_Invoicing_Utils::isInvoicingEnabled());
- $this->addElement('submit', 'ckeditor_config', ts('Configure CKEditor'));
+ $this->addElement('xbutton', 'ckeditor_config', ts('Configure CKEditor'), ['type' => 'submit']);
$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('submit', $this->_testButtonName, ts('Save & Send Test Email'), ['crm-icon' => 'fa-envelope-o']);
+ $attrs = [
+ 'type' => 'submit',
+ 'crm-icon' => 'fa-envelope-o',
+ ];
+ $buttons[] = $this->createElement('xbutton', $this->_testButtonName, ts('Save & Send Test Email'), $attrs);
$this->getElement('buttons')->setElements($buttons);
if (!empty($setStatus)) {
// add the force save button
$forceSave = $this->getButtonName('upload', 'force');
- $this->addElement('submit',
+ $this->addElement('xbutton',
$forceSave,
- ts('Ignore Mismatch & Process the Batch?')
+ ts('Ignore Mismatch & Process the Batch?'),
+ ['type' => 'submit']
);
$this->addButtons([
// This button is hidden but gets clicked by javascript at
// https://github.com/civicrm/civicrm-core/blob/bd28ecf8121a85bc069cad3ab912a0c3dff8fdc5/templates/CRM/Case/Form/CaseView.js#L194
// by the onChange handler for the above timeline_id select.
- $this->addElement('submit', $this->getButtonName('next'), ' ', ['class' => 'hiddenElement']);
+ $this->addElement('xbutton', $this->getButtonName('next'), ' ', [
+ 'class' => 'hiddenElement',
+ 'type' => 'submit',
+ ]);
$this->buildMergeCaseForm();
// This button is hidden but gets clicked by javascript at
// https://github.com/civicrm/civicrm-core/blob/bd28ecf8121a85bc069cad3ab912a0c3dff8fdc5/templates/CRM/Case/Form/CaseView.js#L55
// when the mergeCasesDialog is saved.
- $this->addElement('submit',
+ $this->addElement('xbutton',
$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('submit',
+ $this->addElement('xbutton',
$this->_dedupeButtonName,
- ts('Check for Matching Contact(s)')
+ ts('Check for Matching Contact(s)'),
+ ['type' => 'submit']
);
- $this->addElement('submit',
+ $this->addElement('xbutton',
$this->_duplicateButtonName,
- ts('Save Matching Contact')
+ ts('Save Matching Contact'),
+ ['type' => 'submit']
);
- $this->addElement('submit',
+ $this->addElement('xbutton',
$this->getButtonName('next', 'sharedHouseholdDuplicate'),
- ts('Save With Duplicate Household')
+ ts('Save With Duplicate Household'),
+ ['type' => 'submit']
);
$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('submit', $this->_actionButtonName, ts('Add Contacts to %1', [1 => $this->_group[$this->_amtgID]]),
+ $this->add('xbutton', $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);
- $this->addElement('submit', $this->getButtonName('refresh'), ts('Search'), ['class' => 'crm-form-submit']);
- $this->addElement('submit', $this->getButtonName('cancel'), ts('Cancel'), ['class' => 'crm-form-submit']);
+ $buttonAttrs = [
+ 'type' => 'submit',
+ 'class' => 'crm-form-submit',
+ ];
+ $this->addElement('xbutton', $this->getButtonName('refresh'), ts('Search'), $buttonAttrs);
+ $this->addElement('xbutton', $this->getButtonName('cancel'), ts('Cancel'), $buttonAttrs);
$this->addButtons([
[
'type' => 'next',
// views are implemented as frozen form
if ($this->_action & CRM_Core_Action::VIEW) {
$this->freeze();
- $this->addElement('button', 'done', ts('Done'), ['onclick' => "location.href='civicrm/admin/custom/group?reset=1&action=browse'"]);
+ $this->addElement('xbutton', 'done', ts('Done'), [
+ 'type' => 'button',
+ '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('submit',
+ $this->addElement('xbutton',
$this->_refreshButtonName,
- ts('Save and Preview')
+ ts('Save and Preview'),
+ ['type' => 'submit']
);
parent::buildQuickForm();
$this->addFormRule(['CRM_Contribute_Form_ContributionPage_Widget', 'formRule'], $this);
$this->setDefaults(['onDuplicate' => CRM_Import_Parser::DUPLICATE_SKIP]);
- $this->addElement('submit', 'loadMapping', ts('Load Mapping'), NULL, ['onclick' => 'checkSelect()']);
+ $this->addElement('xbutton', 'loadMapping', ts('Load Mapping'), [
+ 'type' => 'submit',
+ 'onclick' => 'checkSelect()',
+ ]);
$this->addContactTypeSelector();
}
$hasRelationTypes = [];
$columnCount = $columnNo;
- $form->addElement('submit', 'addBlock', ts('Also include contacts where'),
- ['class' => 'submit-link']
+ $form->addElement('xbutton', 'addBlock', ts('Also include contacts where'),
+ [
+ 'type' => 'submit',
+ 'class' => 'submit-link',
+ ]
);
$contactTypes = CRM_Contact_BAO_ContactType::basicTypes();
$form->add('text', "value[$x][$i]", '');
}
- $form->addElement('submit', "addMore[$x]", ts('Another search field'), ['class' => 'submit-link']);
+ $form->addElement('xbutton', "addMore[$x]", ts('Another search field'), [
+ 'type' => 'submit',
+ 'class' => 'submit-link',
+ ]);
}
//end of block for
}
if ($button['type'] === 'reset') {
- $prevnext[] = $this->createElement($button['type'], 'reset', $button['name'], $attrs);
+ $attrs['type'] = 'reset';
+ $prevnext[] = $this->createElement('xbutton', 'reset', $button['name'], $attrs);
}
else {
if (!empty($button['subName'])) {
$attrs['crm-icon'] = $icon;
}
$buttonName = $this->getButtonName($button['type'], CRM_Utils_Array::value('subName', $button));
- $prevnext[] = $this->createElement('submit', $buttonName, $button['name'], $attrs);
+ $attrs['type'] = 'submit';
+ $prevnext[] = $this->createElement('xbutton', $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('submit', $this->_actionButtonName, ts('Go'), ['class' => 'hiddenElement crm-search-go-button']);
+ $this->add('xbutton', $this->_actionButtonName, ts('Go'), [
+ 'type' => 'submit',
+ '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('button',
+ $this->addElement('xbutton',
'done',
ts('Done'),
- ['onclick' => "location.href='$url'"]
+ [
+ 'type' => 'button',
+ '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('button', 'done', ts('Done'), ['onclick' => "location.href='civicrm/admin/custom/group?reset=1&action=browse'"]);
+ $this->addElement('xbutton', 'done', ts('Done'), [
+ 'type' => 'button',
+ '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('button',
+ $this->addElement('xbutton',
'done',
ts('Done'),
- ['onclick' => "location.href='$url'", 'class' => 'crm-form-submit cancel', 'crm-icon' => 'fa-times']
+ [
+ 'type' => 'button',
+ '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('submit', $this->getButtonName('submit'), ts('Add Discount Set to Fee Table'),
- ['class' => 'crm-form-submit cancel']
+ $this->addElement('xbutton', $this->getButtonName('submit'), ts('Add Discount Set to Fee Table'),
+ [
+ 'type' => 'submit',
+ '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('submit', 'export_batch', ts('Export Batch'));
+ $this->add('xbutton', 'export_batch', ts('Export Batch'), ['type' => 'submit']);
}
// 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('submit', 'close_batch', ts('Close Batch'));
+ $this->add('xbutton', 'close_batch', ts('Close Batch'), ['type' => 'submit']);
if (CRM_Batch_BAO_Batch::checkBatchPermission('export', $this->_values['created_id'])) {
- $this->add('submit', 'export_batch', ts('Close & Export Batch'));
+ $this->add('xbutton', 'export_batch', ts('Close & Export Batch'), ['type' => 'submit']);
}
}
ts('Task'),
['' => ts('- actions -')] + ['Remove' => ts('Remove from Batch')]);
- $this->add('submit', 'rSubmit', ts('Go'),
+ $this->add('xbutton', 'rSubmit', ts('Go'),
[
+ 'type' => 'submit',
'class' => 'crm-form-submit',
'id' => 'GoRemove',
]);
ts('Task'),
['' => ts('- actions -')] + ['Assign' => ts('Assign to Batch')]);
- $this->add('submit', 'submit', ts('Go'),
+ $this->add('xbutton', 'submit', ts('Go'),
[
+ 'type' => 'submit',
'class' => 'crm-form-submit',
'id' => 'Go',
]);
ts('Task'),
['' => ts('- actions -')] + $batchAction);
- $this->add('submit', 'submit', ts('Go'),
+ $this->add('xbutton', '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('button',
+ $this->addElement('xbutton',
'done',
ts('Done'),
- ['onclick' => "location.href='$url'"]
+ [
+ 'type' => 'button',
+ 'onclick' => "location.href='$url'",
+ ]
);
}
}
if ($this->_context == 'dialog') {
$this->addElement(
- 'submit',
+ 'xbutton',
$this->_duplicateButtonName,
- ts('Save Matching Contact')
+ ts('Save Matching Contact'),
+ ['type' => 'submit']
);
}
}
if (($this->_multiRecord & CRM_Core_Action::DELETE) && $this->_recordExists) {
$this->_deleteButtonName = $this->getButtonName('upload', 'delete');
- $this->addElement('submit', $this->_deleteButtonName, ts('Delete'));
+ $this->addElement('xbutton', $this->_deleteButtonName, ts('Delete'), ['type' => 'submit']);
return;
}
if (!empty($this->_charts)) {
$this->addElement('select', "charts", ts('Chart'), $this->_charts);
$this->assign('charts', $this->_charts);
- $this->addElement('submit', $this->_chartButtonName, ts('View'));
+ $this->addElement('xbutton', $this->_chartButtonName, ts('View'), ['type' => 'submit']);
}
}
$this->assign('group', TRUE);
}
- $this->addElement('submit', $this->_groupButtonName, '', ['style' => 'display: none;']);
+ $this->addElement('xbutton', $this->_groupButtonName, '', [
+ 'type' => 'submit',
+ '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('button', 'done', ts('Done'),
- ['onclick' => "location.href='civicrm/admin/uf/group/field?reset=1&action=browse&gid=" . $this->_gid . "'"]
+ $this->addElement('xbutton', 'done', ts('Done'),
+ [
+ 'type' => 'button',
+ '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('button', 'done', ts('Done'), ['onclick' => "location.href='civicrm/admin/uf/group?reset=1&action=browse'"]);
+ $this->addElement('xbutton', 'done', ts('Done'), [
+ 'type' => 'button',
+ 'onclick' => "location.href='civicrm/admin/uf/group?reset=1&action=browse'",
+ ]);
}
$this->addFormRule(['CRM_UF_Form_Group', 'formRule'], $this);
<?php } ?>
<p>
- <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')); ?>'" />
+ <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>
<span id="saving_top" style="display: none">
?>
</select>
<noscript>
- <input type="submit" name="setlanguage" value="<?php echo ts('Change language', array('escape' => 'js')); ?>" />
+ <button type="submit" name="setlanguage"><?php echo ts('Change language', ['escape' => 'js']); ?></button>
</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"><input type="submit" value="<?php echo ts('Re-check requirements', array('escape' => 'js')); ?>" /></p>
+<p style="margin-left: 2em"><button type="submit"><?php echo ts('Re-check requirements', ['escape' => 'js']); ?></button></p>
<a name="dbDetails">
html += '<form class="widget-settings">';
html += ' <div class="widget-settings-inner"></div>';
html += ' <div class="widget-settings-buttons">';
- 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 += ' <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 += ' </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']); ?>">
- <input id="db_apply_button" type="submit" name="civisetup[action][Start]" value="<?php echo htmlentities(ts('Apply')); ?>" />
+ <button id="db_apply_button" type="submit" name="civisetup[action][Start]"><?php echo htmlentities(ts('Apply')); ?></button>
<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">
- <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')); ?>'"/>
+ <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>
<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">
- <input id="recheck_button" type="submit" name="civisetup[action][Start]" value="<?php echo htmlentities(ts('Refresh')); ?>" />
+ <button id="recheck_button" type="submit" name="civisetup[action][Start]"><?php echo htmlentities(ts('Refresh')); ?></button>
<div class="advancedTip">
<?php echo ts('After updating your system, refresh to test the requirements again.'); ?>
</div>
*
* @param array $fields
* HTTP inputs -- e.g. with a form element like this:
- * `<input type="submit" name="civisetup[action][Foo]" value="Do the foo">`
+ * `<button type="submit" name="civisetup[action][Foo]">Do the foo</button>`
* @param string $default
* The action-name to return if no other action is identified.
* @return string
<input type="hidden" name="qfKey" value="{crmKey name='CRM_Contact_Form_Contact' addSequence=1}" />
</div>
-<div class="form-item"><input type="submit" name="_qf_Contact_next" value="{ts}Save{/ts}" class="crm-form-submit" /></div>
+<div class="form-item"><button type="submit" name="_qf_Contact_next" class="crm-button crm-form-submit">{ts}Save{/ts}</button></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;" /> <input type="submit" name="submit" id="fulltext_submit" value="{ts}Go{/ts}" class="crm-form-submit"/ onclick='submitForm();'>
+ <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="hidden" name="qfKey" value="{crmKey name='CRM_Contact_Controller_Search' addSequence=1}" />
</div>
<select class="form-select" id="fulltext_table" name="fulltext_table">
{/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"><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>
+ <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>
</div>
</form>
<br />
{ts 1=$display_name 2=$email}Are you sure you want to resubscribe: %1 (%2){/ts}
<br/>
<center>
-<input type="submit" name="_qf_resubscribe_next" value="{ts}Resubscribe{/ts}" class="crm-form-submit" />
+<button type="submit" name="_qf_resubscribe_next" class="crm-button crm-form-submit">{ts}Resubscribe{/ts}</button>
-<input type="submit" name="_qf_resubscribe_cancel" value="{ts}Cancel{/ts}" class="crm-form-submit" />
+<button type="submit" name="_qf_resubscribe_cancel" class="crm-button crm-form-submit">{ts}Cancel{/ts}</button>
</center>
</form>
</div>
<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;"><input type="submit" value="{ts}Go{/ts}" name="_qf_Advanced_refresh" class="crm-form-submit default" /></div>
+ <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>
</form>
<ul>