X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FAdmin%2FForm.php;h=6f18f0060728c8970d7252db95614ca942463b5d;hb=1af588c3575b8517b918793a727ef15778e98f36;hp=4fcf841f6a7cc77947866de6747dd057c8c320f0;hpb=86d6172a4e2d39cd119eead245fcb31106b66972;p=civicrm-core.git diff --git a/CRM/Admin/Form.php b/CRM/Admin/Form.php index 4fcf841f6a..6f18f00607 100644 --- a/CRM/Admin/Form.php +++ b/CRM/Admin/Form.php @@ -1,9 +1,9 @@ _id = $this->get('id'); $this->_BAOName = $this->get('BAOName'); @@ -77,7 +80,7 @@ class CRM_Admin_Form extends CRM_Core_Form { * * @access public * - * @return None + * @return array */ function setDefaultValues() { if (isset($this->_id) && empty($this->_values)) { @@ -96,29 +99,25 @@ class CRM_Admin_Form extends CRM_Core_Form { // its ok if there is no element called is_active $defaults['is_active'] = ($this->_id) ? CRM_Utils_Array::value('is_active', $defaults) : 1; - if (CRM_Utils_Array::value('parent_id', $defaults)) { + if (!empty($defaults['parent_id'])) { $this->assign('is_parent', TRUE); } return $defaults; } /** - * Function to actually build the form + * Add standard buttons * - * @return None + * @return void * @access public */ public function buildQuickForm() { - if ($this->_action & CRM_Core_Action::DELETE) { + if ($this->_action & CRM_Core_Action::VIEW) { $this->addButtons(array( - array( - 'type' => 'next', - 'name' => ts('Delete'), - 'isDefault' => TRUE, - ), array( 'type' => 'cancel', - 'name' => ts('Cancel'), + 'name' => ts('Done'), + 'isDefault' => TRUE, ), ) ); @@ -127,7 +126,7 @@ class CRM_Admin_Form extends CRM_Core_Form { $this->addButtons(array( array( 'type' => 'next', - 'name' => ts('Save'), + 'name' => $this->_action & CRM_Core_Action::DELETE ? ts('Delete') : ts('Save'), 'isDefault' => TRUE, ), array(