Project

General

Profile

« Previous | Next » 

Revision d8de8d4d

Added by Andreas Kohlbecker over 4 years ago

fixing order of typedesignations in registration page

View differences:

modules/cdm_dataportal/includes/name.inc
961 961
  $render_array = array();
962 962

  
963 963
  $type_designation_list = array();
964
  uksort($type_entity_refs, "compare_type_designation_status");
964
  uksort($type_entity_refs, "compare_type_designation_status_labels");
965 965
  foreach($type_entity_refs as $type_status => $specimen_types){
966 966
    foreach($specimen_types as $specimen_type){
967 967

  
......
1641 1641
  return ($aQuantifier < $bQuantifier) ? -1 : 1;
1642 1642
}
1643 1643

  
1644

  
1645
/**
1646
 * Compares two SpecimenTypeDesignation status labels
1647
 *
1648
 * @param string $a
1649
 *   A TypeDesignationStatus label.
1650
 * @param string $b
1651
 *   A TypeDesignationStatus label.
1652
 */
1653
function compare_type_designation_status_labels($a, $b) {
1654

  
1655
  $type_status_order = type_status_order();
1656

  
1657

  
1658
  $aQuantifier = FALSE;
1659
  $bQuantifier = FALSE;
1660
  if (isset($a) && isset($b)) {
1661
    $aQuantifier = array_search($a, $type_status_order);
1662
    $bQuantifier = array_search($b, $type_status_order);
1663
  }
1664
  return ($aQuantifier < $bQuantifier) ? -1 : 1;
1665
}
1666

  
1644 1667
/**
1645 1668
 * @return array
1646 1669
 */

Also available in: Unified diff