Project

General

Profile

« Previous | Next » 

Revision 3d526ffb

Added by Andreas Kohlbecker over 12 years ago

fixing #2679 (Improve Concept Relationships for Dataportal)

View differences:

5.x/modules/cdm_dataportal/theme/cdm_dataportal.taxon.theme
245 245
      $acceptedTaxa = $table_of_accepted[$uuid];
246 246
      if(count($acceptedTaxa) == 1){
247 247
        $acceptedTaxon = $acceptedTaxa[0];
248
        $taxonUri = theme('cdm_uri_to_synonym', $taxon->uuid, $acceptedTaxon->uuid, 'synonymy');
248
        $taxonUri = uri_to_synonym($taxon->uuid, $acceptedTaxon->uuid, 'synonymy');
249 249
        if(isset($acceptedTaxon->name->nomenclaturalReference)){
250 250
          $referenceUri = url(path_to_reference($acceptedTaxon->name->nomenclaturalReference->uuid));
251 251
        }
......
296 296
  $reltype_representation = '';
297 297

  
298 298
  if($inverse) {
299
    $taxon = $taxonRelationship->toTaxon;
299
    $toTaxon = $taxonRelationship->fromTaxon;
300
    $fromTaxon = $taxonRelationship->toTaxon;
300 301
    $relsign = $taxonRelationType->inverseRepresentation_L10n_abbreviatedLabel;
301 302
    $reltype_representation = $taxonRelationType->inverseRepresentation_L10n;
302 303
  } else {
303
    $taxon = $taxonRelationship->fromTaxon;
304
    $toTaxon = $taxonRelationship->toTaxon;
305
    $fromTaxon = $taxonRelationship->fromTaxon;
304 306
    $relsign = $taxonRelationType->representation_L10n_abbreviatedLabel;
305 307
    $reltype_representation = $taxonRelationType->representation_L10n;
306 308
  }
307 309

  
308
  return cdm_related_taxon($taxon, null, $relsign, $reltype_representation, $doLinkTaxon);
310
  return cdm_related_taxon($toTaxon, null, $relsign, $reltype_representation, $doLinkTaxon);
309 311
}
310 312

  
311 313
/**
......
372 374
    $referenceUri = url(path_to_reference($taxon->name->nomenclaturalReference->uuid));
373 375
  }
374 376
  if($doLinkTaxon){
375
    $taxonUri = url(path_to_taxon($taxon->uuid));
377
    $taxonUri = url(path_to_taxon($taxon->uuid, "synonymy"));
376 378
  }
377 379
  //printing the taxonName and the handling the special case of annotations
378
  $nameHtml = theme('cdm_taxonName', $taxon->name, $taxonUri, $referenceUri, true, false, $skiptags);
379
  $special_annotations_array = array();
380
  $special_annotations_array[] = $taxon->name;
381
  $special_annotations_array[] = $taxon;
382
  $nameHtml .= theme('cdm_annotations_as_footnotekeys', $special_annotations_array);
380
  $out_taxon_part = theme('cdm_taxonName', $taxon->name, $taxonUri, $referenceUri, true, false, $skiptags);
381
  $out_taxon_part .= theme('cdm_annotations_as_footnotekeys', array($taxon->name, $taxon) );
382
  $out_taxon_part .= ' sec. ' . theme('cdm_reference',  $taxon->sec);
383

  
383 384

  
384 385
  //later homonym or trated as later homonym AND bloking names
385 386
  $from_name_relations = cdm_ws_get(CDM_WS_PORTAL_TAXON_FROM_NAMERELATIONS, $taxon->uuid);
386 387
  $to_name_relations = cdm_ws_get(CDM_WS_PORTAL_TAXON_TO_NAMERELATIONS, $taxon->uuid);
388

  
387 389
  //first the FROM RELS
390
  //FIXME use UUID below instad of representation_L10n
388 391
  if ($from_name_relations){
389 392
    foreach($from_name_relations as $element){
390 393
      switch ($element->type->representation_L10n){
......
432 435
    }
433 436
  }
434 437
  //geneal output
435
  $out = '<span class="relation_sign" title="' . $reltype_representation . '">'.$relsign.'</span>'.$name_prefix . $nameHtml . $name_postfix . $name_relations_html;
438
  $out = '<span class="relation_sign" title="' . $reltype_representation . '">'.$relsign.'</span>'.$name_prefix . $out_taxon_part . $name_postfix . $name_relations_html;
436 439
  $out = uuid_anchor($taxon->uuid, $out);
437 440

  
438 441
  RenderHints::popFromRenderStack();
......
455 458
  $gallery_name = $taxon->uuid;
456 459

  
457 460
   $mediaQueryParameters = array("type"=>"ImageFile");
458
  $galleryLinkUri = path_to_taxon($taxon->uuid).'/images';
461
  $galleryLinkUri = path_to_taxon($taxon->uuid, 'images');
459 462

  
460 463
  // cdm_dataportal_show_media = ???? TODO
461 464
  $selectShowMedia = variable_get('cdm_dataportal_show_media', 0);

Also available in: Unified diff