Project

General

Profile

« Previous | Next » 

Revision b059b449

Added by Andreas Kohlbecker almost 5 years ago

fix #6380 collecting all type designations of the whole synonymy group

View differences:

modules/cdm_dataportal/theme/cdm_dataportal.name.theme
256 256
 * @see http://drupal.org/node/1354
257 257
 */
258 258
function theme_cdm_heterotypicSynonymyGroup($variables) {
259
  $homotypicalGroup = $variables['homotypicalGroup'];
259
  $homotypical_group = $variables['homotypicalGroup'];
260 260
  RenderHints::pushToRenderStack('heterotypicSynonymyGroup');
261 261

  
262 262
  $out = '';
263 263
  $out = '<div class="heterotypic-synonymy-group"><ul class="heterotypicSynonymyGroup">';
264
  $footnoteListKey = (isset($homotypicalGroup[0]) ? $homotypicalGroup[0]->uuid : 'NULL');
264
  $footnoteListKey = (isset($homotypical_group[0]) ? $homotypical_group[0]->uuid : 'NULL');
265 265
  RenderHints::setFootnoteListKey($footnoteListKey);
266 266

  
267
  $type_designations= type_designations_for_synonymy_group($homotypical_group);
268

  
267 269
  $is_first_entry = TRUE;
268
  $type_designations = NULL;
269
  foreach ($homotypicalGroup as $synonym) {
270
  foreach ($homotypical_group as $synonym) {
270 271
    if ($is_first_entry) {
271 272
      $is_first_entry = FALSE;
272
      $type_designations = cdm_ws_get(CDM_WS_PORTAL_NAME_TYPEDESIGNATIONS, $synonym->name->uuid);
273 273
      // Is first list entry.
274 274
      $out .= '<li class="firstentry synonym">' . cdm_related_taxon($synonym, UUID_HETEROTYPIC_SYNONYM_OF) . '</li>';
275 275
    }
......
278 278
    }
279 279
  }
280 280

  
281
  if ($type_designations) {
281
  if (count($type_designations) > 0) {
282 282
    $out .= theme('cdm_typedesignations', array('typeDesignations' => $type_designations));
283 283
  }
284 284
  $out .= '</ul>';
......
317 317

  
318 318
  RenderHints::pushToRenderStack('homotypicSynonymyGroup');
319 319

  
320
  $homonym_typeDesignations = NULL;
321

  
322
  // TODO improve typeDesignations retrieval: wouldn't it be sufficient to retrieve all typeDesignations
323
  // only from the accepted taxon?
324
  $accepted_typeDesignations = cdm_ws_get(CDM_WS_PORTAL_NAME_TYPEDESIGNATIONS, $accepted_taxon_name_uuid);
320
  $type_designations_in_group = NULL;
325 321

  
326 322
  $out = '<div class="homotypic-synonymy-group">';
327 323

  
......
333 329
    }
334 330
  }
335 331

  
336
  $homonym_typeDesignations = NULL;
337
  if (isset($synonymList[0])) {
332

  
333
    if (isset($synonymList[0])) {
338 334
    foreach ($synonymList as $synonym) {
339 335
      $out .= '<li class="synonym">' . cdm_related_taxon($synonym, UUID_HOMOTYPIC_SYNONYM_OF) . '</li>';
340 336
    }
341
    $homonym_typeDesignations = cdm_ws_get(CDM_WS_PORTAL_NAME_TYPEDESIGNATIONS, $synonymList[0]->name->uuid);
342
  }
343

  
344
  // type designations
345
  if ($accepted_typeDesignations) {
346
    $type_designations = filter_cdm_entity_list($homonym_typeDesignations, $accepted_typeDesignations);
347
  }
348
  else {
349
    $type_designations = $homonym_typeDesignations;
350 337
  }
351 338

  
339
  $type_designations = type_designations_for_synonymy_group($synonymList);
352 340
  if ($type_designations) {
353 341
    $out .= theme('cdm_typedesignations', array('typeDesignations' => $type_designations));
354 342
  }

Also available in: Unified diff