Revision 0c720425
Added by Andreas Kohlbecker over 3 years ago
modules/cdm_dataportal/includes/name.inc | ||
---|---|---|
884 | 884 |
if ($type_designations) { |
885 | 885 |
usort($type_designations, 'compare_specimen_type_designation'); |
886 | 886 |
$render_array['type_designations'] = markup_to_render_array( |
887 |
theme('cdm_typedesignations', array('typeDesignations' => $type_designations, 'enclosing_tag' => 'div', 'element_tag' => 'div'))
|
|
887 |
render_type_designations($type_designations, 'div', 'div')
|
|
888 | 888 |
); |
889 | 889 |
|
890 | 890 |
$render_array['map'] = compose_type_designations_map($type_designations); |
modules/cdm_dataportal/includes/occurrences.inc | ||
---|---|---|
445 | 445 |
$groups, |
446 | 446 |
cdm_occurrence_field_name_label($field), |
447 | 447 |
array( |
448 |
'#markup' => theme('cdm_typedesignations', array('typeDesignations' => $value)),
|
|
448 |
'#markup' => render_type_designations($value),
|
|
449 | 449 |
) |
450 | 450 |
); |
451 | 451 |
break; |
... | ... | |
1342 | 1342 |
$groups, |
1343 | 1343 |
cdm_occurrence_field_name_label($field), |
1344 | 1344 |
array( |
1345 |
'#markup' => theme('cdm_typedesignations', array('typeDesignations' => $value)),
|
|
1345 |
'#markup' => render_type_designations($value),
|
|
1346 | 1346 |
) |
1347 | 1347 |
); |
1348 | 1348 |
break; |
modules/cdm_dataportal/theme/cdm_dataportal.name.theme | ||
---|---|---|
63 | 63 |
/** |
64 | 64 |
* Renders and array of CDM TypeDesignations |
65 | 65 |
* |
66 |
* @param array $variables |
|
67 |
* - typeDesignations: an array of cdm TypeDesignation entities to render |
|
66 |
* @param object $type_designations an array of cdm TypeDesignation entities |
|
67 |
* to render |
|
68 |
* @param string $enclosing_tag the tag element type to enclose the whole list |
|
69 |
* of type designation with. By default this DOM element is <ul> |
|
70 |
* @param string $element_tag the tag element type to be used for each |
|
71 |
* type designation item. |
|
72 |
* @param bool $link_to_specimen_page whether a specimen in type designation element |
|
73 |
* should be a link or not. |
|
74 |
* |
|
75 |
* @return string The markup. |
|
76 |
* |
|
77 |
* @InGroup Render |
|
68 | 78 |
*/ |
69 |
function theme_cdm_typedesignations($variables) { |
|
70 |
$type_designations = $variables['typeDesignations']; |
|
71 |
$enclosing_tag = $variables['enclosing_tag']; |
|
72 |
$element_tag = $variables['element_tag']; |
|
73 |
$link_to_specimen_page = $variables['link_to_specimen_page']; |
|
79 |
function render_type_designations($type_designations, $enclosing_tag = 'ul', $element_tag = 'li', $link_to_specimen_page = true) { |
|
74 | 80 |
|
75 | 81 |
// need to add element to render path since type designations |
76 | 82 |
// need other name render template |
... | ... | |
295 | 301 |
} |
296 | 302 |
|
297 | 303 |
if (count($type_designations) > 0) { |
298 |
$out .= theme('cdm_typedesignations', array('typeDesignations' => $type_designations));
|
|
304 |
$out .= render_type_designations($type_designations);
|
|
299 | 305 |
} |
300 | 306 |
$out .= '</ul>'; |
301 | 307 |
|
modules/cdm_dataportal/theme/cdm_dataportal.references.theme | ||
---|---|---|
18 | 18 |
* Creates a HTML representations for a CDM Reference instance.. |
19 | 19 |
* |
20 | 20 |
* Used by: |
21 |
* - theme_cdm_typedesignations
|
|
21 |
* - render_type_designations
|
|
22 | 22 |
* - cdm_reference_pager |
23 | 23 |
* - cdm_taxonRelationships |
24 | 24 |
* |
modules/cdm_dataportal/theme/theme_registry.inc | ||
---|---|---|
88 | 88 |
'sources_as_content' => FALSE |
89 | 89 |
)), |
90 | 90 |
// Themes in cdm_dataportal.name.theme. |
91 |
'cdm_typedesignations' => array('variables' => array( |
|
92 |
'typeDesignations' => array(), |
|
93 |
'enclosing_tag' => 'ul', |
|
94 |
'element_tag' => 'li', |
|
95 |
'link_to_specimen_page' => true |
|
96 |
) |
|
97 |
), |
|
98 | 91 |
'cdm_nameRelationships' => array('variables' => array('nameRelationships' => NULL, 'skipTypes' => FALSE)), |
99 | 92 |
'cdm_homotypicSynonymLine' => array('variables' => array('taxon' => NULL)), |
100 | 93 |
'cdm_heterotypicSynonymyGroup' => array('variables' => array('homotypicalGroup' => NULL)), |
Also available in: Unified diff
ref #8134 refactoring theme to render function