Revision 2527a83c
Added by Andreas Kohlbecker almost 4 years ago
modules/cdm_dataportal/includes/descriptions.inc | ||
---|---|---|
2091 | 2091 |
} |
2092 | 2092 |
|
2093 | 2093 |
/** |
2094 |
* @param $description
|
|
2095 |
* @param $root_nodes
|
|
2094 |
* @param $root_nodes, for obtaining the root nodes from a description you can
|
|
2095 |
* use the function get_root_nodes_for_dataset($description);
|
|
2096 | 2096 |
* |
2097 | 2097 |
* @return string |
2098 | 2098 |
*/ |
2099 |
function render_description_string($description, $root_nodes, &$item_cnt = 0) {
|
|
2099 |
function render_description_string($root_nodes, &$item_cnt = 0) { |
|
2100 | 2100 |
|
2101 | 2101 |
$out = ''; |
2102 | 2102 |
|
... | ... | |
2129 | 2129 |
} |
2130 | 2130 |
|
2131 | 2131 |
// recurse child nodes |
2132 |
$child_markup = render_description_string($description, $root_node->childNodes, $item_cnt);
|
|
2132 |
$child_markup = render_description_string($root_node->childNodes, $item_cnt); |
|
2133 | 2133 |
if($child_markup){ |
2134 | 2134 |
$description_strings[] = $child_markup; |
2135 | 2135 |
} |
modules/cdm_dataportal/includes/occurrences.inc | ||
---|---|---|
497 | 497 |
break; |
498 | 498 |
|
499 | 499 |
case 'descriptions': |
500 |
$occurrence_featureTree = cdm_get_occurrence_featureTree(); |
|
501 | 500 |
$dd_elements = array(); |
502 |
|
|
503 | 501 |
foreach ($value as $description) { |
504 | 502 |
$description = cdm_ws_get(CDM_WS_PORTAL_DESCRIPTION, $description->uuid); |
505 | 503 |
|
506 | 504 |
if ($description->imageGallery == TRUE) { |
507 | 505 |
continue; |
508 | 506 |
} |
509 |
$elements_by_feature = _mergeFeatureTreeDescriptions($occurrence_featureTree->root->childNodes, $description->elements); |
|
510 |
$description_render_elements = _block_get_renderable_array(make_feature_block_list($elements_by_feature, null)); |
|
511 |
$dd_elements[] = $description_render_elements; |
|
507 |
$description_string = render_description_string(get_root_nodes_for_dataset($description)); |
|
508 |
$dd_elements[] = markup_to_render_array($description_string); |
|
512 | 509 |
} |
513 |
|
|
514 | 510 |
@_description_list_group_add($groups, cdm_occurrence_field_name_label($field), $dd_elements); |
515 | 511 |
break; |
516 | 512 |
case '_derivedUnitMedia': |
modules/cdm_dataportal/includes/pages.inc | ||
---|---|---|
574 | 574 |
$description_item = ''; |
575 | 575 |
foreach ($aggregatedDescriptions as $description) { |
576 | 576 |
$description_item = '<div class="' . html_class_attribute_ref($description) . '">'; |
577 |
$description_item .= render_description_string($description, get_root_nodes_for_dataset($description));
|
|
577 |
$description_item .= render_description_string(get_root_nodes_for_dataset($description)); |
|
578 | 578 |
$description_item .= ' ' . icon_link(path_to_description($description->uuid)); |
579 | 579 |
$description_item .= '<div class="content-caption">'. statistical_values_explanation() . '</div>'; |
580 | 580 |
$description_item .= '</div>'; |
... | ... | |
1097 | 1097 |
$specimen_table = array( |
1098 | 1098 |
'#theme' => 'table', |
1099 | 1099 |
'#weight' => 2, |
1100 |
// prefix attributes and rows with '#' to let it pass toF the theme function,
|
|
1100 |
// prefix attributes and rows with '#' to let it pass to the theme function, |
|
1101 | 1101 |
// otherwise it is handled as child render array |
1102 | 1102 |
|
1103 | 1103 |
'#attributes' => array('class' => 'specimens'), |
... | ... | |
1130 | 1130 |
// 'content' => $specimen_table, |
1131 | 1131 |
// '#suffix' => '</div>', |
1132 | 1132 |
// ); |
1133 |
$render_array['specimen_table'] = $specimen_table;
|
|
1133 |
$render_array['specimen_table'] = $specimen_table; |
|
1134 | 1134 |
|
1135 | 1135 |
RenderHints::popFromRenderStack(); |
1136 | 1136 |
return $specimen; // $render_array; |
Also available in: Unified diff
fix #8895 fix showing specimen descriptions as running text