Project

General

Profile

« Previous | Next » 

Revision 78a42a9b

Added by Katja Luther about 5 years ago

fix specimen details from compressed table

View differences:

modules/cdm_dataportal/includes/pages.inc
1249 1249
  drupal_set_title("Specimen Details");
1250 1250
  $render_array = array();
1251 1251
  RenderHints::pushToRenderStack('specimen_page');
1252
  if (variable_get('cdm_dataportal_compressed_specimen_derivate_table')){
1253
      $specimen = cdm_ws_get(CDM_WS_PORTAL_OCCURRENCE, array($specimen_uuid, 'specimenDerivates'));
1254 1252

  
1255
      $detail_html = render_cdm_specimen_page($specimen, true);
1256
      $render_array['specimen_html'] = array(
1257
          '#markup' => $detail_html
1258
      );
1259
  }else{
1260
      $specimen_table = array(
1261
          '#theme' => 'table',
1262
          '#weight' => 2,
1263
          // prefix attributes and rows with '#' to let it pass toF the theme function,
1264
          // otherwise it is handled as child render array
1265
          '#attributes' => array('class' => 'specimens'),
1266
          '#rows' => array(),
1267
      );
1268
      $specimen = compose_cdm_specimen_or_observation($specimen_uuid, true);
1269
      $renderArray = array(
1270
              '#theme' => 'item_list',
1271
              '#items' => array($specimen),
1272
              '#type' => 'ul');
1273
      $output = drupal_render($renderArray);
1274

  
1275
      $specimen_table['#rows'][] = array(
1276
              // An array of table rows. Every row is an array of cells, or an associative array
1277
              'data' => array($output),
1278
              'class' =>  array(
1279
                  'descriptionElement',
1280
                  'descriptionElement_IndividualsAssociation'
1281
              ),
1282
      );
1253
  $specimen_table = array(
1254
      '#theme' => 'table',
1255
      '#weight' => 2,
1256
      // prefix attributes and rows with '#' to let it pass toF the theme function,
1257
      // otherwise it is handled as child render array
1258
      '#attributes' => array('class' => 'specimens'),
1259
      '#rows' => array(),
1260
  );
1261
  $specimen = compose_cdm_specimen_or_observation($specimen_uuid, true);
1262
  $renderArray = array(
1263
          '#theme' => 'item_list',
1264
          '#items' => array($specimen),
1265
          '#type' => 'ul');
1266
  $output = drupal_render($renderArray);
1267

  
1268
  $specimen_table['#rows'][] = array(
1269
          // An array of table rows. Every row is an array of cells, or an associative array
1270
          'data' => array($output),
1271
          'class' =>  array(
1272
              'descriptionElement',
1273
              'descriptionElement_IndividualsAssociation'
1274
          ),
1275
  );
1283 1276

  
1284 1277

  
1285
     // $detail_html = compose_cdm_specimen_or_observation($specimen_uuid, true);
1286
      $render_array['markup'] =  $specimen_table;
1278
 // $detail_html = compose_cdm_specimen_or_observation($specimen_uuid, true);
1279
  $render_array['markup'] =  $specimen_table;
1280

  
1287 1281

  
1288
  }
1289 1282
  RenderHints::popFromRenderStack();
1290 1283
  return $render_array;
1291 1284
}

Also available in: Unified diff