Project

General

Profile

« Previous | Next » 

Revision 71a05785

Added by Andreas Kohlbecker over 3 years ago

ref #8419 refactoring to harmonize dto and entitiy code

View differences:

modules/cdm_dataportal/includes/occurrences.inc
331 331
}
332 332

  
333 333
/**
334
 * Compose an render array from a CDM DerivedUnitFacade object.
334
 * Compose an render array from a CDD SpecimenOrObservation entity.
335 335
 *
336 336
 * compose_hook() implementation
337 337
 *
338 338
 * @param object $specimen_or_observation
339
 *   the CDM instance of type SpecimenOrObservation to compose
340
 *   the render array for
339
 *   the CDM FieldUnit or DerivedUnit to compose
340
 *   the render array for.
341 341
 * @param bool $isSpecimen_page
342 342
 * @param array $derivatives
343 343
 *   the render array which contains the compositions of the derivatives
......
356 356
    $exclude_occurrence_fields = &drupal_static(__FUNCTION__);
357 357
    if (!isset($exclude_occurrence_fields)) {
358 358
        $exclude_occurrence_fields = array(
359

  
359
            'uuid',
360 360
            'titleCache',
361 361
            'protectedTitleCache',
362 362
            'derivedUnitMedia',
......
364 364
            'publish',
365 365
            'updated',
366 366
            'class',
367
            'uuid',
368 367
            'collectionCode'
369 368
        );
370 369
    }
......
372 371
        $exclude_occurrence_fields[] = 'derivationEvents';
373 372
    }
374 373

  
375
    // only show uuid it the user is logged in
376
 //   if(user_is_logged_in() && ($a_idx = array_search('uuid', $exclude_occurrence_fields)) !== FALSE ) {
377
  //      unset($exclude_occurrence_fields[$a_idx]);
378
  //  }
379

  
380 374
    if (!isset($derivatives)) {
381 375
        $derivatives = array();
382 376
    }
......
1278 1272
    $exclude_occurrence_fields = &drupal_static(__FUNCTION__);
1279 1273
    if (!isset($exclude_occurrence_fields)) {
1280 1274
        $exclude_occurrence_fields = array(
1281
            'type',
1282
            'taxonRelatedDerivedUnits',
1283
            'label',
1275
            'uuid',
1284 1276
            'titleCache',
1285
            'listLabel',
1286 1277
            'protectedTitleCache',
1278
            'label',
1279
            'listLabel',
1287 1280
            'class',
1288
            'uuid',
1281
            'type',
1282
            'taxonRelatedDerivedUnits',
1289 1283
            'derivates',
1290 1284
            'collectionCode'
1291 1285
        );
1292 1286
    }
1293 1287

  
1294
    // only show uuid it the user is logged in
1295
    if (user_is_logged_in() && ($a_idx = array_search('uuid', $exclude_occurrence_fields)) !== FALSE) {
1296
      //  unset($exclude_occurrence_fields[$a_idx]);
1297
    }
1298

  
1299 1288
    if (is_object($specimen_or_observation_dto)) {
1300 1289

  
1301 1290
        $type_label = $specimen_or_observation_dto->recordBase;
......
1372 1361
                            'showCaption' => true
1373 1362
                        ));
1374 1363

  
1375
                         //@_description_list_group_add($groups, cdm_occurrence_field_name_label($field), $gallery_html);
1364
                         //FIXME re-enable: // @_description_list_group_add($groups, cdm_occurrence_field_name_label($field), $gallery_html);
1376 1365
                         break;
1377 1366

  
1378
                    /* ---- DerivedUnitBase --- */
1367
                         // TODO
1368
                        case 'sex':
1369
                        case 'lifeStage':
1370
                        case 'kindOfUnit':
1371
                          @_description_list_group_add($groups, cdm_occurrence_field_name_label($field), $value->representation_L10n);
1372
                          break;
1379 1373

  
1380
                    case 'collection':
1381
                      @_description_list_group_add($groups, cdm_occurrence_field_name_label($field), array(
1382
                        array('#markup' => render_collection_dto($value))
1383
                      ));
1384
                      break;
1374
                        case 'definition':
1375
                          // TODO
1376
                          break;
1377

  
1378
                        /* ---- DerivedUnitBase --- */
1379

  
1380
                        case 'collection':
1381
                          @_description_list_group_add($groups, cdm_occurrence_field_name_label($field), array(
1382
                            array('#markup' => render_collection_dto($value))
1383
                          ));
1384
                          break;
1385 1385

  
1386 1386
                    /* ---- Specimen --- */
1387 1387
                    case 'sequences':

Also available in: Unified diff