Project

General

Profile

« Previous | Next » 

Revision c7e854d5

Added by Patrick Plitzner over 4 years ago

ref #8595 Only show feature table when data available

View differences:

modules/cdm_dataportal/includes/pages.inc
1237 1237
  $description = cdm_ws_get(CDM_WS_PORTAL_DESCRIPTION, [$description_uuid]);
1238 1238
  $dataSet = NULL;
1239 1239
  // find dataset
1240
  if($descriptive_dataset_uuid != NULL){
1240
  if ($descriptive_dataset_uuid != NULL) {
1241 1241
    foreach ($description->descriptiveDataSets as $set) {
1242
      if($set->uuid == $descriptive_dataset_uuid){
1242
      if ($set->uuid == $descriptive_dataset_uuid) {
1243 1243
        $dataSet = $set;
1244 1244
        break;
1245 1245
      }
1246 1246
    }
1247 1247
  }
1248
  if (!isset($dataSet) && !empty($description->descriptiveDataSets) && sizeof($description->descriptiveDataSets)==1) {
1248
  if (!isset($dataSet) && !empty($description->descriptiveDataSets) && sizeof($description->descriptiveDataSets) == 1) {
1249 1249
    foreach ($description->descriptiveDataSets as $dataSet) {
1250 1250
      break;
1251 1251
    }
......
1260 1260
      $title .= ' for ' . $associated_description_cdm_entity;
1261 1261
    }
1262 1262
    drupal_set_title($title);
1263
    if(isset($description->types)){
1263
    if (isset($description->types)) {
1264 1264
      foreach ($description->types as $type) {
1265
        if($type == 'CLONE_FOR_SOURCE'){
1266
          $render_array[] = markup_to_render_array("Aggregation source from ".$description->created.'<br><br>');
1265
        if ($type == 'CLONE_FOR_SOURCE') {
1266
          $render_array[] = markup_to_render_array("Aggregation source from " . $description->created . '<br><br>');
1267 1267
          break;
1268 1268
        }
1269 1269
      }
1270 1270
    }
1271 1271
  }
1272
  else{
1272
  else {
1273 1273
    $items = [];
1274 1274
    foreach ($description->descriptiveDataSets as $dataSet) {
1275 1275
      $path = path_to_description($description->uuid, $dataSet->uuid);
1276 1276
      $attributes['class'][] = html_class_attribute_ref($description);
1277 1277
      $items[] = [
1278
        'data' => $dataSet->titleCache.get_icon_link($path),
1278
        'data' => $dataSet->titleCache . get_icon_link($path),
1279 1279
      ];
1280 1280
    }
1281 1281
    $render_array[] = [
......
1303 1303
  $rows = [];
1304 1304
  $rows = compose_description_element_rows($root_nodes, $rows);
1305 1305

  
1306
  $render_array[] = markup_to_render_array(theme('table', [
1307
    'header' => $header,
1308
    'rows' => $rows,
1309
  ]));
1306
  if (!empty($rows)) {
1307
    $render_array[] = markup_to_render_array(theme('table', [
1308
      'header' => $header,
1309
      'rows' => $rows,
1310
    ]));
1311
  }
1310 1312

  
1311 1313
  if (isset($description->sources) and !empty($description->sources)) {
1312 1314
    $items = [];

Also available in: Unified diff