From b61fd8cf3197c2f5d7359a078697c715188af90d Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Wed, 12 Mar 2014 20:12:26 -0400 Subject: [PATCH] CRM-13863 - Ensure cancel button gets needed css class --- CRM/Core/Form.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/CRM/Core/Form.php b/CRM/Core/Form.php index 767cc9dd8c..9d6e0603bd 100644 --- a/CRM/Core/Form.php +++ b/CRM/Core/Form.php @@ -443,6 +443,10 @@ class CRM_Core_Form extends HTML_QuickForm_Page { $attrs = array_merge($js, $attrs); } + if ($button['type'] === 'cancel') { + $attrs['class'] .= ' cancel'; + } + if ($button['type'] === 'reset') { $prevnext[] = $this->createElement($button['type'], 'reset', $button['name'], $attrs); } @@ -454,8 +458,7 @@ class CRM_Core_Form extends HTML_QuickForm_Page { $buttonName = $this->getButtonName($button['type']); } - if (in_array($button['type'], array( - 'next', 'upload')) && $button['name'] === 'Save') { + if (in_array($button['type'], array('next', 'upload', 'done')) && $button['name'] === ts('Save')) { $attrs = array_merge($attrs, (array('accesskey' => 'S'))); } $prevnext[] = $this->createElement('submit', $buttonName, $button['name'], $attrs); -- 2.25.1