Project

General

Profile

Revision 92e522db

ID92e522dbb7039adeddce7e54f76ca1768a7a68f1
Parent 31d293b1
Child e95b14dd

Added by Andreas Kohlbecker 11 months ago

ref #8739 description sources in alphabetical order

View differences:

modules/cdm_dataportal/includes/descriptions.inc
2119 2119

  
2120 2120
}
2121 2121

  
2122

  
2123
/**
2124
 * Renders the description and adds a link to the description detail page
2125
 *
2126
 * @param object $description
2127
 *     the cdm description entity which will be linked to
2128
 *
2129
 * @param bool $show_description_elements
2130
 *     if True the description elements will be rendered
2131
 * @param $descriptive_dataset_uuid
2132
 *     the data set which should be passed to the description detail page
2133
 *
2134
 * @return string the markup for the description
2135
 */
2136
function render_cdm_description($description, $show_description_elements = False, $descriptive_dataset_uuid = NULL) {
2137

  
2138
  $out = '<span class="' . html_class_attribute_ref($description) . '">' . $description->titleCache . '</span>';
2139
  $path_to_description = path_to_description($description->uuid, $descriptive_dataset_uuid);
2140
  if($show_description_elements){
2141
    $out = render_description_string($description, get_root_nodes_for_dataset($description));
2142
  }
2143
  $out .= ' ' . icon_link($path_to_description);
2144

  
2145
  if($show_description_elements){
2146
    $out .= '<div class="content-caption">'. t('Bracketed numbers denote sample size') . '</div>';
2147
  }
2148

  
2149
  return $out;
2150
}
2151

  
2152 2122
/**
2153 2123
 * @param $description
2154 2124
 * @param $root_nodes
......
2320 2290
          case 'TaxonDescription':
2321 2291
          case 'NameDescription':
2322 2292
          case 'SpecimenDescription':
2323
            $source_link_markup = render_cdm_description($cdm_source_entity);
2293
            $source_link_markup = render_cdm_entity_link($cdm_source_entity);
2324 2294
            break;
2325 2295
          default:
2326 2296
            $source_link_markup = '<span class="error">unhandled CdmSource</span>';
2327 2297
        }
2328
        $items[] = [
2298
        $items[$cdm_source_entity->titleCache] = [
2329 2299
          'data' => $source_link_markup
2330 2300
        ];
2331 2301
      }
2332 2302
    }
2303
    ksort($items);
2333 2304
    $render_array['sources'] = [
2334 2305
      '#title' => 'Sources',
2335 2306
      '#theme' => 'item_list',

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)