Project

General

Profile

« Previous | Next » 

Revision 98262d29

Added by Katja Luther over 5 years ago

code cleaning

View differences:

modules/cdm_dataportal/includes/occurrences.inc
63 63
    if (isset($specimen->types)) {
64 64
        //typed taxa
65 65
        foreach ($specimen->types as $typeStatus => $typedTaxa) {
66
/* Updated upstream
67
            if($specimen->types){
68
                $detail_html .= "<i>".$typeStatus."</i> of ";
69
                foreach($typedTaxa as $typedTaxon){
70
                    $detail_html .= $typedTaxon." ";
71
                }
72
                $detail_html .= "<br>";
73
*/
74 66
            if ($is_specimen_page) {
75 67
                if ($specimen->types) {
76 68
                    $detail_html .= "<i>" . $typeStatus . "</i>: ";
......
246 238
 *
247 239
 * @ingroup compose
248 240
 */
249
/*<<<<<<< Updated upstream
250
function compose_cdm_specimen_or_observation($specimenOrObservation, &$derivatives = null) {
251

  
252
  $exclude_occurrence_fields = &drupal_static(__FUNCTION__);
253
  if (!isset($exclude_occurrence_fields)) {
254
     $exclude_occurrence_fields = array(
255
        'derivationEvents',
256
        'titleCache',
257
        'protectedTitleCache',
258
        'derivedUnitMedia',
259
        'created',
260
        'publish',
261
        'updated',
262
        'class',
263
        'uuid',
264
       ''
265
    );
266
  }
267

  
268 241

  
269
  // only show uuid it the user is logged in
270
  if(user_is_logged_in() && ($a_idx = array_search('uuid', $exclude_occurrence_fields)) !== FALSE ) {
271
    unset($exclude_occurrence_fields[$a_idx]);
272
  }
273

  
274
  if (!isset($derivatives)) {
275
    $derivatives = array();
276
  }
277

  
278
  $descriptions = null;
279
  $derivedFrom = null;
280
=======*/
281
function compose_cdm_specimenOrObservation($specimenOrObservation, &$derivatives = null)
242
function compose_cdm_specimen_or_observation($specimenOrObservation, &$derivatives = null)
282 243
{
283

  
284
//>>>>>>> Stashed changes
285 244
    $exclude_occurrence_fields = &drupal_static(__FUNCTION__);
286 245
    if (!isset($exclude_occurrence_fields)) {
287 246
        $exclude_occurrence_fields = array(
......
320 279

  
321 280
        $type_label = $specimenOrObservation->recordBase;
322 281
        RenderHints::setFootnoteListKey($type_label . '-' . $specimenOrObservation->uuid);
323
        /*
324
         * $label_html = cdm_dynabox(
325
                          $specimenOrObservation->uuid,
326
                          $type_label . $specimenOrObservation->titleCache,
327
                          $derived_unit_ws_request, //cdm_ws_get("portal/" . CDM_WS_OCCURRENCE, $specimenOrObservation->uuid);
328
                          'cdm_specimenOrObservation',
329
                          'Click for details',
330
                          array('div', 'div'),
331
                          array(),
332
                          null, // $content_element_selector
333
                          'function(){ jQuery(\'#media_gallery_' . $gallery_name . '\').hide(); }', // open_callback
334
                          'function(){ jQuery(\'#media_gallery_' . $gallery_name . '\').show(); }' // close_callback
335
                        );
336 282

  
337
         */
338 283
        // collect typeStatus as label
339 284
        if (isset($specimenOrObservation->specimenTypeDesignations)) {
340 285
            $type_status = array();
......
622 567

  
623 568
                }
624 569

  
625
/*
626
 *
627
          default:
628
            if (is_object($value) || is_array($value)) {
629
              drupal_set_message("Unhandled type in compose_cdm_specimen_or_observation() for field " . $field, "warning");
630
            } else {
631
              _description_list_group_add($groups, cdm_occurrence_field_name_label($field), $value);
632
*/
633
// Stashed changes
570

  
634 571
            }
635 572
        } // END of loop over $derivedUnitFacade fields
636 573

  
......
672 609
        }
673 610

  
674 611
        if (isset($derivates)) {
675
            if (isset($derivedFrom->originals)) {
612
            if (isset($derivates->originals)) {
676 613
                $derived_from_label = t('derivated');
677 614
                // $preposition = t('from');
678 615
                if (isset($derivedFrom->type)) {
......
698 635

  
699 636
            }
700 637
        }
701
/*<<<<<<< Updated upstream
702
        foreach ($derivedFrom->originals as $original) {
703
          compose_cdm_specimen_or_observation($original, $derivatives);
704
=======*/
638

  
705 639
        if (isset($derivates )) {
706 640

  
707 641
            foreach ($derivates as $derivate){
708
                compose_cdm_specimenOrObservation($derivate, $derivatives);
642
                compose_cdm_specimen_or_observation($derivate, $derivatives);
709 643
            }
710
//>>>>>>> Stashed changes
644

  
711 645
        }
712 646

  
713 647
    } // END of $specimenOrObservation exists
modules/cdm_dataportal/includes/pages.inc
65 65
    // order occurrences by date but types should be on top of the list
66 66
    $type_specimens = array();
67 67
    $other_occurrences = array();
68
    foreach ($specimensOrObservations as &$occurrence) {
68
    foreach ($specimensOrObservations as $occurrence) {
69 69
        $typeDesignationsPager = cdm_ws_get(CDM_WS_OCCURRENCE . '/$0/specimenTypeDesignations', $occurrence->uuid);
70 70
        if (isset($typeDesignationsPager->count) && $typeDesignationsPager->count > 0) {
71 71
            $type_specimens[] = $occurrence;

Also available in: Unified diff