Project

General

Profile

Download (20.2 KB) Statistics
| Branch: | Tag: | Revision:
1
<?php
2

    
3
/**
4
 * @file
5
 * Functions for dealing with CDM entities from the package model.taxon
6
 *
7
 * @copyright
8
 *   (C) 2007-2016 EDIT
9
 *   European Distributed Institute of Taxonomy
10
 *   http://www.e-taxonomy.eu
11
 *
12
 *   The contents of this module are subject to the Mozilla
13
 *   Public License Version 1.1.
14
 * @see http://www.mozilla.org/MPL/MPL-1.1.html
15
 *
16
 * @author
17
 *   - Andreas Kohlbecker <a.kohlbecker@BGBM.org>
18
 */
19

    
20
/**
21
 * @defgroup compose Compose functions
22
 * @{
23
 * Functions which are composing Drupal render arrays
24
 *
25
 * The cdm_dataportal module needs to compose rather complex render arrays from
26
 * the data returned by the CDM REST service. The compose functions are
27
 * responsible for creating the render arrays.
28
 *
29
 * All these functions are also implementations of the compose_hook()
30
 * which is used in the proxy_content() function.
31
 * @}
32
 */
33

    
34

    
35
/**
36
 * Returns HTML for misapplied names and invalid designations.
37
 *
38
 * Both relation types are currently treated the same!
39
 *
40
 * @param taxonRelationships
41
 * @param focusedTaxon
42
 *
43
 * @return string
44
 *    the rendered html
45
 */
46
function cdm_taxonRelationships($taxonRelationships, $focusedTaxon){
47

    
48
  static $NULL_AUTHORTEAM = 'NULL_AUTHORTEAM';
49

    
50
  if (!$taxonRelationships) {
51
    return null;
52
  }
53

    
54
  RenderHints::pushToRenderStack('taxon_relationships');
55
  $footnoteListKey = 'taxon_relationships';
56
  RenderHints::setFootnoteListKey($footnoteListKey);
57

    
58
  $misapplied = array();
59
  $joinedAuthorTeams = array();
60

    
61
  $taxon_relationship_types = variable_get(CDM_TAXON_RELATIONSHIP_TYPES, unserialize(CDM_TAXON_RELATIONSHIP_TYPES_DEFAULT));
62

    
63
  // Aggregate misapplied names having the same fullname:
64
  //  - deduplicate misapplied names, so that the same name it not shown multiple times in case it
65
  //    the duplicates only have different sensu references/author teams (see #5647)
66
  //  - show the author team as sec reference
67
  //  - show the according reference as footnote to this author team
68
  //  - if the sec reference has no author team it should show instead the title cache
69
  //
70
  // Example:
71
  // "Xenoxylum foobar" sensu Grumbach¹; sensu Lem²
72
  //    1. Novel marsian species, Grumbach, 2022
73
  //    2. Flora solaris, Lem, 2019
74
  foreach ($taxonRelationships as $taxonRelation) {
75

    
76
    if (in_array($taxonRelation->type->uuid, $taxon_relationship_types)) {
77

    
78
      if ($taxonRelation->type->uuid == UUID_MISAPPLIED_NAME_FOR || $taxonRelation->type->uuid == UUID_INVALID_DESIGNATION_FOR) {
79

    
80
        RenderHints::pushToRenderStack('misapplied_name_for'); // TODO the render path string should in future come from $taxonRelation->type->...
81

    
82
        $name = $taxonRelation->fromTaxon->name->titleCache;
83

    
84
        $sensu_citation_footnote_str = null;
85

    
86
        if(isset($taxonRelation->fromTaxon->sec)) {
87

    
88
          $sensu_citation_footnote_str = theme('cdm_reference', array('reference' => $taxonRelation->fromTaxon->sec));
89
          $authorteam = cdm_ws_get(CDM_WS_REFERENCE_AUTHORTEAM, $taxonRelation->fromTaxon->sec->uuid);
90

    
91
          if(isset($authorteam->titleCache)){
92
            $authorteam_str = $authorteam->titleCache;
93
            if($taxonRelation->fromTaxon->sec->titleCache == $authorteam->titleCache){
94
              // no need for a footnote in case the reference only consists of the author team
95
              $sensu_citation_footnote_str = '';
96
            }
97
          } else {
98
            $authorteam_str = $sensu_citation_footnote_str;
99
            // no need for a footnote in case in case it is used as replacement for missing author teams
100
            $sensu_citation_footnote_str = '';
101
          }
102
        } else {
103
          // taxa not always are have a sec reference (e.g. doubtful taxa)
104
          // use the NULL_AUTHORTEAM in this case
105
          $authorteam_str = $NULL_AUTHORTEAM;
106
        }
107

    
108
        if (!isset($misapplied[$name])) {
109
          // Render the first name found as representative for all others.
110
          $misapplied[$name]['out'] = cdm_related_taxon($taxonRelation->fromTaxon, UUID_MISAPPLIED_NAME_FOR);
111
        }
112
        else {
113
          // We need to add the anchors for all of the other misapplied names not
114
          // being rendered explicitly.
115
          $misapplied[$name]['out'] = uuid_anchor($taxonRelation->fromTaxon->uuid, $misapplied[$name]['out']);
116
        }
117

    
118
        // Collect all authors for this fullname.
119
        if (isset($authorteam_str) && $authorteam_str != $NULL_AUTHORTEAM) {
120
          // prepare entry for the footnote key of the sensu citation footnote
121
          $misapplied[$name]['authorteam'][$authorteam_str] = '';
122
          // map sensu citation footnote to the authorteam string
123
          $joinedAuthorTeams[$authorteam_str] = $sensu_citation_footnote_str;
124

    
125
        }
126

    
127
      }
128
      else {
129
        RenderHints::pushToRenderStack('other_taxon_relationship');
130
        // All relationsship types but misapplied_name_for
131
        // invalid_designation_for.
132
        $taxon_relationships_lines[] = cdm_taxonRelationship($taxonRelation, TRUE, _is_invers_taxonRelationship($taxonRelation, $focusedTaxon));
133
      }
134

    
135
      RenderHints::popFromRenderStack();
136
    }
137
  }
138

    
139
  // Sort the joinedAuthorTeams and create footnotes and footnotekeys.
140
  ksort($joinedAuthorTeams);
141
  $author_team_cnt = 0;
142
  foreach ($joinedAuthorTeams as $authorteam_str => $sensu_citation) {
143
    $footnoteKey = '';
144
    if(!empty($sensu_citation)) {
145
      $footnoteKey = FootnoteManager::addNewFootnote($footnoteListKey, 'sensu ' . $sensu_citation);
146
      $footnoteKey = theme('cdm_footnote_key', array('footnoteKey' => $footnoteKey));
147
    }
148
    $sensu = '';
149
    if($authorteam_str != $NULL_AUTHORTEAM){
150
      $sensu = ++$author_team_cnt == 0 ? '' : 'sensu ' . $authorteam_str;
151
    }
152
    $joinedAuthorTeams[$authorteam_str] = '<span class="sensu">' . $sensu . $footnoteKey .'</span>';
153
  }
154

    
155
  // ---- Generate output ---- //
156

    
157
  $out = '<div class="taxon-relationships">';
158
  if (is_array($misapplied) && count($misapplied) > 0) {
159
    $out .= '<ul class="misapplied">';
160
    foreach ($misapplied as $misapplied_name) {
161

    
162
      $out .= '<li class="synonym"><span class="misapplied">' . $misapplied_name['out'] . ' </span>';
163

    
164
      if (isset($misapplied_name['authorteam'])) {
165
        // Fill authors with the renderedFootnoteKey and sorting 'em.
166
        foreach ($misapplied_name['authorteam'] as $authorteam_str => &$renderedFootnoteKey) {
167
          $renderedFootnoteKey = $joinedAuthorTeams[$authorteam_str];
168
        }
169
        ksort($misapplied_name['authorteam']);
170
        $out .= join('; ', $misapplied_name['authorteam']);
171
      }
172
      $out .= '</li>';
173
    }
174
    $out .= '</ul>';
175
  }
176

    
177
  if (isset($taxon_relationships_lines) && is_array($taxon_relationships_lines) && count($taxon_relationships_lines) > 0) {
178
    $out .= '<ul class="taxonRelationships">';
179
    foreach ($taxon_relationships_lines as $taxon_relationship_line) {
180
      $out .= '<li class="synonym">' . $taxon_relationship_line . '</li>';
181
    }
182
    $out .= '</ul>';
183
  }
184

    
185
  $footnotes = theme('cdm_footnotes', array('footnoteListKey' => $footnoteListKey, 'enclosingTag' => 'li'));
186
  $footnotes .= theme('cdm_annotation_footnotes', array('footnoteListKey' => $footnoteListKey, 'enclosingTag' => 'li'));
187

    
188
// AK: why splitting footnotes at the sensu string ??? this is weired and hacky
189
//     TODO remove below dead code
190
//   $tr_footnotes_exploded = explode('sensu', $tr_footnotes);
191
//   $tr_footnotes_aux = '';
192
//   foreach ($tr_footnotes_exploded as $element) {
193
//     $tr_footnotes_aux .= $element;
194
//   }
195

    
196
  $out .= '<ul class="footnotes">' . $footnotes . '</ul>';
197

    
198
  $out .= '</div>';
199

    
200
  RenderHints::popFromRenderStack();
201
  return $out;
202
}
203

    
204

    
205
/**
206
 * Renders a representation of the given taxon relationship.
207
 *
208
 * According name relationships are also being rendered.
209
 *
210
 * @param $taxonRelationship
211
 * @param boolean $doLinkTaxon
212
 *     whether to create a link to the related taxon
213
 * @param boolean $inverse
214
 *     whether the $taxonRelationship should be treaded as invers relation
215
 *
216
 * @return void|string
217
 */
218
function cdm_taxonRelationship($taxonRelationship, $doLinkTaxon = FALSE, $inverse = FALSE) {
219

    
220
  // Validate object.
221
  if (!(isset($taxonRelationship->toTaxon) && isset($taxonRelationship->fromTaxon) && isset($taxonRelationship->type))) {
222
    return null;
223
  }
224

    
225
  $taxonRelationType = $taxonRelationship->type;
226

    
227
  if ($inverse) {
228
    $toTaxon = $taxonRelationship->fromTaxon;
229
    $relsign = $taxonRelationType->inverseRepresentation_L10n_abbreviatedLabel;
230
    $reltype_representation = $taxonRelationType->inverseRepresentation_L10n;
231
  }
232
  else {
233
    $toTaxon = $taxonRelationship->toTaxon;
234
    $relsign = $taxonRelationType->representation_L10n_abbreviatedLabel;
235
    $reltype_representation = $taxonRelationType->representation_L10n;
236
  }
237

    
238
  return cdm_related_taxon($toTaxon, NULL, $relsign, $reltype_representation, $taxonRelationship->doubtful, $doLinkTaxon);
239
}
240

    
241
/**
242
 * Renders a representation of the given taxon relationship.
243
 *
244
 * According name relationships are also being rendered.
245
 *
246
 * @param $taxon
247
 *  The CDM TaxonBase entity
248
 * @param $reltype_uuid
249
 *  The UUID of the TaxonRelationshipType
250
 * @param $relsign
251
 *  Optional. Can be  used to override the internal decision strategy on finding a suitable icon for the relationship
252
 * @param $reltype_representation
253
 *   Optional: Defines the value for the title attribute of the html element enclosing the relsign
254
 * @param $doubtful
255
 *   TODO
256
 * @param $doLinkTaxon
257
 *   The taxon will be rendered as clickable link when true.
258
 *
259
 * @return string
260
 *   Markup for the taxon relationship.
261
 */
262
function cdm_related_taxon($taxon, $reltype_uuid = NULL, $relsign = NULL, $reltype_representation = NULL, $doubtful=false, $doLinkTaxon = FALSE) {
263
  static $relsign_homo = '≡';
264
  static $relsign_hetero = '=';
265
  static $relsign_invalid = '&ndash;';
266
  static $nom_status_invalid_type_uuids =  array(
267
    UUID_NOMENCLATURALSTATUS_TYPE_INVALID,
268
    UUID_NOMENCLATURALSTATUS_TYPE_NUDUM,
269
    UUID_NOMENCLATURALSTATUS_TYPE_COMBINATIONINVALID,
270
    UUID_NOMENCLATURALSTATUS_TYPE_PROVISIONAL
271
  );
272

    
273
  // 'taxonRelationships';
274
  $footnoteListKey = NULL;
275

    
276
  $skip_tags = array();
277

    
278
  $is_invalid = false;
279

    
280
  if (!$relsign) {
281

    
282
    switch ($reltype_uuid) {
283
      case UUID_HETEROTYPIC_SYNONYM_OF:
284
      case UUID_SYNONYM_OF:
285
        $relsign = $relsign_hetero;
286
        break;
287

    
288
      case UUID_HOMOTYPIC_SYNONYM_OF:
289
        $relsign = $relsign_homo;
290
        break;
291

    
292
      case UUID_MISAPPLIED_NAME_FOR:
293
      case UUID_INVALID_DESIGNATION_FOR:
294
        $skip_tags[] = 'authors';
295
        $is_invalid = true;
296
        $relsign = $relsign_invalid;
297

    
298
        break;
299

    
300
      default:
301
        $relsign = $relsign_invalid;
302
    }
303

    
304
  }
305

    
306
  if($doubtful) {
307
    $relsign = '?' . $relsign;
308
  }
309

    
310
  /*
311
  Names with status invalid or nudum are to be displayed with the
312
  $relsign_invalid, these names appear at the end of all names in their
313
  homotypic group (ordered correctly by the java cdm_lib).
314
  */
315
  if (isset($taxon->name->status) && is_array($taxon->name->status)) {
316
    foreach ($taxon->name->status as $status) {
317
      if (in_array($status->type->uuid , $nom_status_invalid_type_uuids)) {
318
        $relsign = $relsign_invalid;
319
        break;
320
      }
321
    }
322
  }
323

    
324
  // Now rendering starts ..
325
  RenderHints::pushToRenderStack('related_taxon');
326

    
327
  if (isset($taxon->name->nomenclaturalReference)) {
328
    $referenceUri = url(path_to_reference($taxon->name->nomenclaturalReference->uuid));
329
  }
330
  $taxonUri = '';
331
  if ($doLinkTaxon) {
332
    $taxonUri = url(path_to_taxon($taxon->uuid, "synonymy"));
333
  }
334
  // Printing the taxonName and the handling the special case of annotations.
335
  if (!isset($referenceUri)) {
336
    $referenceUri = FALSE;
337
  }
338
  $out_taxon_part = render_taxon_or_name($taxon, $taxonUri, $referenceUri, TRUE, FALSE, $skip_tags, $is_invalid);
339
  $taxon_footnotes = theme('cdm_annotations_as_footnotekeys',
340
    array('cdmBase_list' => array(
341
      $taxon->name,
342
      $taxon,
343
    ),
344
      'footnote_list_key' => $footnoteListKey)
345
  );
346

    
347
  $homonyms = cdm_name_relationships_of($taxon);
348

    
349
  $out = '<span class="relation_sign" title="' . $reltype_representation . '">' . $relsign . '</span>'
350
    . $out_taxon_part . $taxon_footnotes . ' '  . $homonyms;
351

    
352
  $out = uuid_anchor($taxon->uuid, $out);
353

    
354
  RenderHints::popFromRenderStack();
355

    
356
  return $out;
357
}
358

    
359

    
360
/**
361
 * Creates markup for a taxon which is the accepted of another one
362
 *
363
 * @param $accepted_for_uuid
364
 *   The uuid of the accepted taxon
365
 */
366
function cdm_accepted_for($accepted_for_uuid) {
367

    
368
  if(!is_uuid($accepted_for_uuid)){
369
    return '';
370
  }
371

    
372
  RenderHints::pushToRenderStack('acceptedFor');
373
  $out = '';
374

    
375
  $synonym = cdm_ws_get(CDM_WS_PORTAL_TAXON, $accepted_for_uuid);
376
  if ($synonym) {
377
    $out .= '<span class="acceptedFor">';
378
    $out .= t('is accepted for ');
379
    if (isset($synonym->name->nomenclaturalReference)) {
380
      $referenceUri = url(path_to_reference($synonym->name->nomenclaturalReference->uuid));
381
    }
382
    $out .= render_taxon_or_name($synonym->name, NULL, $referenceUri);
383
    $out .= theme('cdm_annotations_as_footnotekeys', array('cdmBase_list' => $synonym));
384
    $out .= '</span>';
385
  }
386
  RenderHints::popFromRenderStack();
387
  return $out;
388
}
389

    
390
/**
391
 * Compose function for a list of taxa.
392
 *
393
 * This function is for example used to display search results or the taxa for a taxon name in the name page.
394
 *
395
 * @param $taxon_list array
396
 *   The list of CDM Taxon entities. e.g. The records array as contained in a pager object.
397
 * @param $freetext_search_results array
398
 * @param $show_classification boolean
399
 *
400
 * @ingroup compose
401
 *
402
 */
403
function compose_list_of_taxa($taxon_list, $freetext_search_results = array(), $show_classification = false) {
404

    
405
  $unclassified_snippet = '<span class="unclassified">' . t('unclassified') . '</span>';
406

    
407
  RenderHints::pushToRenderStack('list_of_taxa');
408

    
409
  $gallery_settings = getGallerySettings(CDM_DATAPORTAL_SEARCH_GALLERY_NAME);
410

    
411
  $showMedia_taxa = $gallery_settings['cdm_dataportal_show_taxon_thumbnails'];
412
  $showMedia_synonyms = $gallery_settings['cdm_dataportal_show_synonym_thumbnails'];
413
  $searched_in_classification = cdm_dataportal_searched_in_classification();
414
  $searched_in_classification_uuid = null;
415
  if(isset($searched_in_classification->uuid)){
416
    $searched_in_classification_uuid = $searched_in_classification->uuid;
417
  }
418

    
419
  // .. Well, for sure not as performant as before, but better than nothing.
420
  $synonym_uuids = array();
421
  $misappied_uuids = array();
422
  foreach ($taxon_list as $taxon) {
423
    if ($taxon->class == "Synonym") {
424
      if (!array_key_exists($taxon->uuid, $synonym_uuids)) {
425
        $synonym_uuids[$taxon->uuid] = $taxon->uuid;
426
      }
427
    }
428
    elseif (!_cdm_dataportal_acceptedByCurrentView($taxon)) {
429
      // Assuming that it is a misappied name, will be further examined below.
430
      $misappied_uuids[$taxon->uuid] = $taxon->uuid;
431
    }
432
  }
433

    
434
  // Batch service not jet implemented:
435
  // $table_of_accepted = cdm_ws_property(CDM_WS_PORTAL_TAXON_ACCEPTED,
436
  // join(',', $synonym_uuids));
437
  // thus ...
438
  $table_of_accepted = array();
439

    
440
  foreach ($synonym_uuids as $relatedUuid) {
441
    $table_of_accepted[$relatedUuid] = cdm_ws_get(CDM_WS_PORTAL_TAXON_ACCEPTED,
442
      array($relatedUuid),
443
      'classificationFilter=' . $searched_in_classification_uuid
444
    );
445
  }
446

    
447
  foreach ($misappied_uuids as $relatedUuid) {
448
    $taxonRelations = cdm_ws_get(CDM_WS_PORTAL_TAXON_RELATIONS, array(
449
      $relatedUuid,
450
    ));
451
    foreach ($taxonRelations as $relation) {
452
      if ($relation->type->uuid == UUID_MISAPPLIED_NAME_FOR && _cdm_dataportal_acceptedByCurrentView($relation->toTaxon)) {
453
        $table_of_accepted[$relatedUuid][] = $relation->toTaxon;
454
      }
455
    }
456
  }
457

    
458
  $out = '<ul class="cdm_names" style="background-image: none;">';
459
  $itemCnt = -1;
460
  foreach ($taxon_list as $taxon) {
461
    $itemCnt++;
462
    if (isset($table_of_accepted[$taxon->uuid])) {
463
      // Its a synonym or misapplied name.
464
      $is_synonym = isset($synonym_uuids[$taxon->uuid]); //TODO better use the $taxon->class attribute?
465
      $taxon_type = $is_synonym ? "Synonym" : "misapplied-name";
466

    
467
      $acceptedTaxon = $table_of_accepted[$taxon->uuid];
468

    
469
      if (is_object($acceptedTaxon)) {
470

    
471
        $taxonUri = uri_to_synonym($taxon->uuid, $acceptedTaxon->uuid);
472
        $referenceUri = '';
473
        if (isset($acceptedTaxon->name->nomenclaturalReference)) {
474
          $referenceUri = url(path_to_reference($acceptedTaxon->name->nomenclaturalReference->uuid));
475
        }
476
        $taxon_or_name = $is_synonym ? $taxon->name : $taxon;
477
        // $taxon_or_name this is a trick to suppress the sec reference for sysnonyms
478
        // supplying the name will cause render_taxon_or_name() to not show the sec reference
479
        $out .= '<li class="' . $taxon_type . '">' . render_taxon_or_name($taxon_or_name, $taxonUri, $referenceUri);
480
        if ($show_classification) {
481
          $classifications = get_classifications_for_taxon($taxon);
482
          $classification_titles = array();
483
          foreach ($classifications as $classification) {
484
            if (isset($classification->titleCache)) {
485
              $classification_titles[] = $classification->titleCache;
486
            }
487
          }
488
          if (count($classification_titles) == 0) {
489
            $classification_titles[] = $unclassified_snippet;
490
          }
491
          $out .= '<span class="classifications"><span class="separator"> : </span>' . implode(', ', $classification_titles) . '</span>';
492
        }
493
        $out .= theme('cdm_annotations_as_footnotekeys', array('cdmBase_list' => $taxon));
494
        if ($showMedia_synonyms) {
495
          $out .= theme('cdm_taxon_list_thumbnails', array('taxon' => $acceptedTaxon));
496
        }
497
      }
498
    }
499
    else {
500
      // Its a Taxon.
501
      $taxonUri = url(path_to_taxon($taxon->uuid));
502
      $referenceUri = '';
503
      if (isset($taxon->name->nomenclaturalReference)) {
504
        $referenceUri = url(path_to_reference($taxon->name->nomenclaturalReference->uuid));
505
      }
506
      $out .= '<li class="Taxon">' . render_taxon_or_name($taxon, $taxonUri, $referenceUri);
507
      if ($show_classification) {
508
        $classifications = get_classifications_for_taxon($taxon);
509
        $classification_titles = array();
510
        foreach ($classifications as $classification) {
511
          if (isset($classification->titleCache)) {
512
            $classification_titles[] = $classification->titleCache;
513
          }
514
        }
515
        if(count($classification_titles) == 0){
516
          $classification_titles[] = $unclassified_snippet;
517
        }
518
        $out .= '<span class="classifications"><span class="separator"> : </span>' . implode(', ', $classification_titles) . '</span>';
519
      }
520
      $out .= theme('cdm_annotations_as_footnotekeys', array('cdmBase_list' => $taxon));
521

    
522
      if ($showMedia_taxa) {
523
        $out .= theme('cdm_taxon_list_thumbnails', array('taxon' => $taxon));
524
      }
525
    }
526

    
527
    /*
528
     * the score field will be empty in case of MultiTermQueries like
529
     * WildcardQueries, since these are  constant score by default
530
     * since Lucene 2.9
531
     */
532
    if(isset($freetext_search_results[$itemCnt]) && $freetext_search_results[$itemCnt]->score && $freetext_search_results[$itemCnt]->maxScore){
533
      $percentage =  ( $freetext_search_results[$itemCnt]->score / $freetext_search_results[$itemCnt]->maxScore ) * 100;
534
      $out .= '<div class="score-bar"><div class="score-bar-indicator" style="width:' . $percentage .'% "></div></div>';
535
      $out .= '<div class="score-bar-value">' . number_format($percentage, 2) .'%</div>';
536
    }
537

    
538
    // Render highlighted fragments, these are made available by free text
539
    // searches.
540
    if (isset($freetext_search_results[$itemCnt]->fieldHighlightMap)) {
541
      $field_fragments = (array) $freetext_search_results[$itemCnt]->fieldHighlightMap;
542
      if (count($field_fragments) > 0) {
543
        $fragments_out = '';
544
        foreach ($field_fragments as $fieldName => $fragments) {
545
          $fragments_out .= '... <span class="' . $fieldName. '">' . filter_xss(join(" ... ", $fragments), array('b') ) . '</span>';
546
        }
547
        $out .= '<div class="fragment_highlight">' . $fragments_out . ' ...</div>';
548
      }
549
    }
550

    
551
    $out .= '</li>';
552
  }
553

    
554
  $out .= '</ul>';
555
  RenderHints::popFromRenderStack();
556

    
557
  return markup_to_render_array($out); // TODO create render array of all list items in function
558
}
559

    
560

    
561
function compose_taxonomic_children($taxon_uuid){
562

    
563
  $render_array = array();
564
  
565
  if($taxon_uuid) {
566
    $children = cdm_ws_get(CDM_WS_PORTAL_TAXONOMY_CHILDNODES_OF_TAXON, array(
567
      get_current_classification_uuid(),
568
      $taxon_uuid
569
      ));
570
    if($children){
571
      $taxonomic_children = theme('cdm_taxontree', array('tree' => $children));
572
      $render_array = markup_to_render_array($taxonomic_children);
573
    }
574
  }
575
  return $render_array;
576
}
577

    
(10-10/10)