Project

General

Profile

« Previous | Next » 

Revision 9e2aa1ff

Added by Andreas Kohlbecker about 8 years ago

defined sort order for original sources

View differences:

modules/cdm_dataportal/theme/cdm_dataportal.descriptions.theme
340 340

  
341 341
}
342 342

  
343
/**
344
 * @todo Please document this function.
345
 * @see http://drupal.org/node/1354
346
 */
347
function compare_image_sources($a, $b) {
348
  if ($a->multilanguageText_L10n->text == $b->multilanguageText_L10n->text) {
349
    return 0;
350
  }
351
  return ($a->multilanguageText_L10n->text < $b->multilanguageText_L10n->text) ? -1 : 1;
352
}
353 343

  
354 344
/**
355 345
 * @todo Please document this function.
......
364 354
  RenderHints::setFootnoteListKey(UUID_IMAGE_SOURCES);
365 355

  
366 356
  // Sorting the image sources.
367
  usort($image_sources, "compare_image_sources");
357
  usort($image_sources, 'compare_image_sources');
368 358
  // Generate the footnotes.
369 359
  foreach ($image_sources as $image_source) {
370 360
    $footNoteKeys = cdm_annotations_as_footnotekeys($image_source);
......
414 404
  }
415 405
  if (isset($identificationKey->sources) && is_array($identificationKey->sources)) {
416 406
    // order and display sources.
407
    //TODO can the method handle_annotations_and_sources() be used here?
417 408
    $sources = oder_sources($identificationKey->sources, TRUE);
418 409
    $out .= '<div class="sources">';
419 410
    $out .=  implode('', $sources);

Also available in: Unified diff