X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FAdmin%2FForm.php;h=6f18f0060728c8970d7252db95614ca942463b5d;hb=1af588c3575b8517b918793a727ef15778e98f36;hp=deed07256111e9689a39f0123a493ebb1a5c3c34;hpb=a5af58bcf2ca094903fb19fb511392aeaf788c16;p=civicrm-core.git diff --git a/CRM/Admin/Form.php b/CRM/Admin/Form.php index deed072561..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'); @@ -78,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)) { @@ -97,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, ), ) ); @@ -128,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(