+
+ $displayStyle = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_CustomGroup',
+ $this->_groupId,
+ 'style'
+ );
+
+ if ($displayStyle === 'Tab with table' && $this->_multiRecordDisplay != 'single') {
+ $ctype = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact',
+ $this->_contactId,
+ 'contact_type'
+ );
+
+ $this->assign('displayStyle', 'tableOriented');
+ // here the multi custom data listing code will go
+ $multiRecordFieldListing = TRUE;
+ $page = new CRM_Profile_Page_MultipleRecordFieldsListing();
+ $page->set('contactId', $this->_contactId);
+ $page->set('customGroupId', $this->_groupId);
+ $page->set('action', CRM_Core_Action::BROWSE);
+ $page->set('multiRecordFieldListing', $multiRecordFieldListing);
+ $page->set('pageViewType', 'customDataView');
+ $page->set('contactType', $ctype);
+ $page->run();
+ }
+ else {
+ $recId = NULL;
+ if ($this->_multiRecordDisplay == 'single') {
+ $recId = $this->_recId;
+ $this->assign('multiRecordDisplay', $this->_multiRecordDisplay);
+ $this->assign('skipTitle', 1);
+ }
+ CRM_Core_BAO_CustomGroup::buildCustomDataView($this, $groupTree, FALSE, NULL, NULL, $recId);
+ }