get('register')) { $this->_mode = CRM_Profile_Form::MODE_REGISTER; } else { $this->_mode = CRM_Profile_Form::MODE_EDIT; } if ($this->get('skipPermission')) { $this->_skipPermission = TRUE; } // also allow dupes to be updated for edit in my account (CRM-2232) $this->_isUpdateDupe = TRUE; parent::preProcess(); } /** * Function to actually build the form * * @return void * @access public */ public function buildQuickForm() { $this->addButtons(array( array( 'type' => 'upload', 'name' => ts('Save'), 'isDefault' => TRUE, ), ) ); // also add a hidden element for to trick drupal $this->addElement('hidden', "edit[civicrm_dummy_field]", "CiviCRM Dummy Field for Drupal"); parent::buildQuickForm(); $this->addFormRule(array('CRM_Profile_Form_Dynamic', 'formRule'), $this); } /** * global form rule * * @param array $fields the input form values * @param array $files the uploaded files if any * @param array $options additional user data * * @return true if no errors, else array of errors * @access public * @static */ static function formRule($fields, $files, $form) { $errors = array(); // if no values, return if (empty($fields) || !CRM_Utils_Array::value('edit', $fields)) { return TRUE; } return CRM_Profile_Form::formRule($fields, $files, $form); } /** * Process the user submitted custom data values. * * @access public * * @return void */ public function postProcess() { parent::postProcess(); } }