assign('previewField', $isSingleField); } if ($flag) { $this->assign('viewOnly', FALSE); } else { $this->assign('viewOnly', TRUE); } $this->set('fieldId', NULL); $this->assign("fields", $fields); $this->_fields = $fields; } /** * Set the default form values * * @access protected * * @return array the default array reference */ function setDefaultValues() { $defaults = array(); foreach ($this->_fields as $name => $field) { if ($customFieldID = CRM_Core_BAO_CustomField::getKeyID($field['name'])) { CRM_Core_BAO_CustomField::setProfileDefaults($customFieldID, $name, $defaults, NULL, CRM_Profile_Form::MODE_REGISTER); } } //set default for country. CRM_Core_BAO_UFGroup::setRegisterDefaults($this->_fields, $defaults); return $defaults; } /** * Build the form object * * @return void * @access public */ public function buildQuickForm() { foreach ($this->_fields as $name => $field) { if (empty($field['is_view'])) { CRM_Core_BAO_UFGroup::buildProfile($this, $field, CRM_Profile_Form::MODE_CREATE); } } } /** * Use the form name to create the tpl file name * * @return string * @access public */ /** * @return string */ public function getTemplateFileName() { return 'CRM/UF/Form/Preview.tpl'; } }