X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FAdmin%2FForm.php;h=0f6a1d407b0faa4089aff54964b7165d683eb518;hb=db89844a9c76000502a24414cbdbe602b389bb4f;hp=5d72d72d869dd320d11f848ae22e0dc7b6119361;hpb=a055fd3bcb8341e6a9c25e32432cf4f4776a2781;p=civicrm-core.git diff --git a/CRM/Admin/Form.php b/CRM/Admin/Form.php index 5d72d72d86..0f6a1d407b 100644 --- a/CRM/Admin/Form.php +++ b/CRM/Admin/Form.php @@ -1,9 +1,9 @@ _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 void * @access public */ public function buildQuickForm() { - if ($this->_action & CRM_Core_Action::DELETE) { - $this->addButtons(array( - array( - 'type' => 'next', - 'name' => ts('Delete'), - 'isDefault' => TRUE, - ), - array( - 'type' => 'cancel', - 'name' => ts('Cancel'), - ), - ) - ); - } - elseif ($this->_action & CRM_Core_Action::VIEW) { + if ($this->_action & CRM_Core_Action::VIEW || $this->_action & CRM_Core_Action::PREVIEW) { $this->addButtons(array( array( 'type' => 'cancel', @@ -140,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(