Project

General

Profile

Revision 6679207a

ID6679207a899188bbae8fba986cf4655a6fd2e87d
Parent ad6ad4c6
Child f02e26e1

Added by Andreas Kohlbecker about 2 months ago

ref #9222 adapting dataportal and tests to single sourced classes

View differences:

modules/cdm_dataportal/includes/name.inc
251 251
 * part_definitions and render_templates (see get_partDefinition() and
252 252
 * get_nameRenderTemplate())
253 253
 *
254
 * @param $taxonName
255
 *    cdm TaxonName instance
254
 * @param $taxon_name_or_taxon_base
255
 *    A cdm TaxonBase or TaxonName entity
256 256
 * @param $name_link
257
 *    URI to the taxon, @see path_to_taxon(), must be processed by url() before passing to this method
258
 * @param $reference_link
259
 *    URI to the reference, @see path_to_reference(), must be processed by url() before passing to this method
260
 * @param $show_annotations
257
 *    URI to the taxon, @param $reference_link
258
 *    URI to the reference, @param bool $show_annotations
261 259
 *    turns the display of annotations on
262
 * @param $is_type_designation
260
 * @param bool $is_type_designation
263 261
 *    To indicate that the supplied taxon name is a name type designation.
264
 * @param $skiptags
262
 * @param array $skiptags
265 263
 *    an array of name elements tags like 'name', 'rank' to skip. The name part
266 264
 *          'authors' will not ber affected by this filter. This part is managed though the render template
267 265
 *          mechanism.
268
 * @param $is_invalid
266
 * @param bool $is_invalid
269 267
 *   Indicates that this taxon is invalid. In this case the name part will be shown in double quotes.
270 268
 *   This is useful when rendering taxon relation ships.
271 269
 *
272 270
 * @return string
273 271
 *  The markup for a taxon name.
274
 *
272
 * @see path_to_taxon(), must be processed by url() before passing to this method
273
 * @see path_to_reference(), must be processed by url() before passing to this method
275 274
 */
276 275
function render_taxon_or_name($taxon_name_or_taxon_base, $name_link = NULL, $reference_link = NULL,
277 276
  $show_annotations = true, $is_type_designation = false, $skiptags = array(), $is_invalid = false) {
......
413 412
    // Komma nach dem Autornamen ist ├╝berall dort falsch, wo ein "in" folgt."
414 413
    if (isset($renderTemplate['referencePart']['reference'])) {
415 414
      $microreference = NULL;
416
      if (isset($renderTemplate['referencePart']['microreference'])&& isset($taxonName->nomenclaturalMicroReference)) {
417
        $microreference = $taxonName->nomenclaturalMicroReference;
415
      if (isset($renderTemplate['referencePart']['microreference'])&& isset($taxonName->nomenclaturalSource->citationMicroReference)) {
416
        $microreference = $taxonName->nomenclaturalSource->citationMicroReference;
418 417
      }
419
      if(count($nomref_tagged_text) == 0 && isset($taxonName->nomenclaturalReference)){
418
      if(count($nomref_tagged_text) == 0 && isset($taxonName->nomenclaturalSource->citation)){
420 419
        // TODO is this case still relevant? The tagged text should already contain all information!
421
        $citation = cdm_ws_getNomenclaturalReference($taxonName->nomenclaturalReference->uuid, $microreference);
420
        $citation = cdm_ws_getNomenclaturalReference($taxonName->nomenclaturalSource->citation->uuid, $microreference);
422 421
        // Find preceding element of the reference.
423 422
        $precedingKey = get_preceding_contentElementKey('reference', $renderTemplate);
424 423
        if (str_beginsWith($citation, ", in")) {
......
460 459

  
461 460
  $is_reference_year = false;
462 461
  if (isset($renderTemplate['referenceYearPart']['reference.year'])) {
463
    if(isset($taxonName->nomenclaturalReference->datePublished)){
464
      $referenceArray['#html'] = ' <span class="reference">' . timePeriodToString($taxonName->nomenclaturalReference->datePublished) . '</span>';
462
    if(isset($taxonName->nomenclaturalSource->citation->datePublished)){
463
      $referenceArray['#html'] = ' <span class="reference">' . timePeriodToString($taxonName->nomenclaturalSource->citation->datePublished) . '</span>';
465 464
      array_setr('reference.year', $referenceArray, $renderTemplate);
466 465
      $is_reference_year = true;
467 466
    }
......
935 934

  
936 935
        }
937 936
        $referenceUri = '';
938
        if (isset($name_type_designation->typeName->nomenclaturalReference)) {
939
          $referenceUri = url(path_to_reference($name_type_designation->typeName->nomenclaturalReference->uuid));
937
        if (isset($name_type_designation->typeName->nomenclaturalSource->citation)) {
938
          $referenceUri = url(path_to_reference($name_type_designation->typeName->nomenclaturalSource->citation->uuid));
940 939
        }
941 940
        $out .= ': ' . render_taxon_or_name($name_type_designation->typeName, $link_to_name_page, $referenceUri, TRUE, TRUE);
942 941
      }

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)