Revision c079337e
Added by Andreas Kohlbecker almost 6 years ago
modules/cdm_dataportal/cdm_api/cdm_api.module | ||
---|---|---|
2535 | 2535 |
return strcmp($term1->representation_L10n, $term2->representation_L10n); |
2536 | 2536 |
} |
2537 | 2537 |
|
2538 |
function compare_terms_by_order_index($term1, $term2) { |
|
2539 |
|
|
2540 |
|
|
2541 |
if (!isset($term1->orderIndex)) { |
|
2542 |
$a = 0; |
|
2543 |
} else { |
|
2544 |
$a = $term1->orderIndex; |
|
2545 |
} |
|
2546 |
if (!isset($term2->orderIndex)) { |
|
2547 |
$b = 0; |
|
2548 |
} else { |
|
2549 |
$b = $term2->orderIndex; |
|
2550 |
} |
|
2551 |
|
|
2552 |
if ($a == $b) { |
|
2553 |
return 0; |
|
2554 |
} |
|
2555 |
return ($a < $b) ? -1 : 1; |
|
2556 |
|
|
2557 |
} |
|
2558 |
|
|
2538 | 2559 |
|
2539 | 2560 |
/** |
2540 | 2561 |
* Make a 'deep copy' of an array. |
Also available in: Unified diff
fix #6087 sorting areas by orderIndex