function form_get_data_for_profile_summary_display($form, $entity) { $form_id = $form->getGUID(); $data = form_get_data_from_profile($form_id, $entity); $area_data = array(); $maps = form_get_maps($form_id); if ($maps) { foreach ($maps as $map) { $field = get_entity($map->field_id); $internalname = $field->internal_name; if (isset($data[$internalname]) && $data[$internalname]->value) { $area = $field->area; if ($area) { if (!isset($area_data[$area])) { $area_data[$area] = array(); } $item = new StdClass(); $item->internalname = $internalname; $item->title = form_field_t($form, $field, 'title'); $item->description = form_field_t($form, $field, 'description'); $item->value = form_get_field_output($form, $field, $data[$internalname]->value); $area_data[$area][] = $item; } } } } return $area_data; }
function form_get_tabbed_output_display($form, $data) { $form_id = $form->getGUID(); $tab_data = array(); $maps = form_get_maps($form_id); if ($maps) { foreach ($maps as $map) { $field = get_entity($map->field_id); if ($field->field_type != 'access') { $internalname = $field->internal_name; if (isset($data[$internalname]) && $data[$internalname]->value) { if (!$field->tab) { if ($form->translate) { $tab = form_tab_t($form, elgg_echo('form:basic_tab_label')); } else { $tab = elgg_echo('form:basic_tab_label'); } } else { $tab = form_tab_t($form, $field->tab); } if (!isset($tab_data[$tab])) { $tab_data[$tab] = ''; } $title = form_field_t($form, $field, 'title'); $value = form_get_field_output($form, $field, $data[$internalname]->value); $tab_data[$tab] .= elgg_view('form/extended_display_field', array('title' => $title, 'value' => $value)); } } } } return $tab_data; }