Revision 3db61e83
Added by Andreas Kohlbecker over 4 years ago
modules/cdm_dataportal/includes/descriptions.inc | ||
---|---|---|
2142 | 2142 |
} |
2143 | 2143 |
$out .= icon_link($path_to_description); |
2144 | 2144 |
|
2145 |
$out .= '<div class="content-caption">Bracketed numbers denote sample size.</div>'; |
|
2145 |
if($show_description_elements){ |
|
2146 |
$out .= '<div class="content-caption">Bracketed numbers denote sample size.</div>'; |
|
2147 |
} |
|
2146 | 2148 |
|
2147 | 2149 |
return $out; |
2148 | 2150 |
} |
... | ... | |
2265 | 2267 |
} |
2266 | 2268 |
|
2267 | 2269 |
|
2270 |
$described_entities = []; |
|
2268 | 2271 |
if (isset($description->describedSpecimenOrObservation)) { |
2269 |
$render_array['specimen'] = markup_to_render_array("<b>Specimen</b><br>");
|
|
2270 |
$render_array['specimen_link'] = markup_to_render_array(render_cdm_specimen_link($description->describedSpecimenOrObservation));
|
|
2272 |
$decr_entitiy = '<span class="label">Specimen:</span> ' . render_cdm_specimen_link($description->describedSpecimenOrObservation);
|
|
2273 |
$described_entities['specimen'] = markup_to_render_array($decr_entitiy, null, '<div>', '</div>');
|
|
2271 | 2274 |
} |
2272 | 2275 |
if (isset($description->taxon)) { |
2273 |
$render_array['taxon'] = markup_to_render_array("<b>Taxon</b><br>"); |
|
2274 |
$render_array['taxon_link'] = markup_to_render_array(render_taxon_or_name($description->taxon, url(path_to_taxon($description->taxon->uuid)))); |
|
2276 |
$decr_entitiy = '<span class="label">Taxon:</span> ' . render_taxon_or_name($description->taxon, url(path_to_taxon($description->taxon->uuid))); |
|
2277 |
$described_entities['taxon'] = markup_to_render_array($decr_entitiy, null, '<div>', '</div>'); |
|
2278 |
} |
|
2279 |
|
|
2280 |
if(count($described_entities)){ |
|
2281 |
$render_array['described_entities'] = $described_entities; |
|
2282 |
$render_array['described_entities']['#prefix'] = '<div class="described-entities">'; |
|
2283 |
$render_array['described_entities']['#suffix'] = '</div>'; |
|
2275 | 2284 |
} |
2276 | 2285 |
|
2286 |
|
|
2277 | 2287 |
$root_nodes = get_root_nodes_for_dataset($description); |
2278 | 2288 |
|
2279 | 2289 |
$header = ['Feature/Character', 'State']; |
... | ... | |
2282 | 2292 |
$rows = compose_description_element_rows($root_nodes, $rows); |
2283 | 2293 |
|
2284 | 2294 |
if (!empty($rows)) { |
2285 |
$render_array[] = markup_to_render_array(theme('table', [ |
|
2295 |
$render_array['table'] = markup_to_render_array(theme('table', [
|
|
2286 | 2296 |
'header' => $header, |
2287 | 2297 |
'rows' => $rows, |
2288 | 2298 |
'caption' => "Bracketed numbers denote sample size.", |
... | ... | |
2300 | 2310 |
$source_link_markup = render_taxon_or_name($cdm_source_entity) . icon_link(path_to_taxon($cdm_source_entity->uuid, false), generalizeString(PSEUDO_FEATURE_AGGREGATION_DESCRIPTIONS)); |
2301 | 2311 |
break; |
2302 | 2312 |
case 'TaxonDescription': |
2303 |
case 'SpecimenDescription': |
|
2304 | 2313 |
case 'NameDescription': |
2314 |
case 'SpecimenDescription': |
|
2305 | 2315 |
$source_link_markup = render_cdm_description($cdm_source_entity); |
2306 | 2316 |
break; |
2307 | 2317 |
default: |
... | ... | |
2312 | 2322 |
]; |
2313 | 2323 |
} |
2314 | 2324 |
} |
2315 |
$render_array[] = [ |
|
2325 |
$render_array['sources'] = [
|
|
2316 | 2326 |
'#title' => 'Sources', |
2317 | 2327 |
'#theme' => 'item_list', |
2318 | 2328 |
'#type' => 'ul', |
2319 | 2329 |
'#items' => $items, |
2330 |
'#attributes' => ['class' => 'sources'] |
|
2320 | 2331 |
]; |
2332 |
$render_array['#prefix'] = '<div class="description-table">'; |
|
2333 |
$render_array['#suffix'] = '</div>'; |
|
2321 | 2334 |
} |
2322 | 2335 |
|
2323 | 2336 |
RenderHints::popFromRenderStack(); |
Also available in: Unified diff
ref #8739 description page: improved dom and using stylesheets instead of html tags