Sorts a structured array by the 'weight' and then by 'title' element.
Callback for uasort() in views_fetch_base_tables().
array $a: First item for comparison. The compared items should be associative arrays that include a 'weight' and title element.
array $b: Second item for comparison.
int -1 if the first item comes first, 1 if second and 0 if they have the same order.
function _views_weight_sort($a, $b) {
if ($a['weight'] != $b['weight']) {
return $a['weight'] < $b['weight'] ? -1 : 1;
}
if ($a['title'] != $b['title']) {
return $a['title'] < $b['title'] ? -1 : 1;
}
return 0;
}