You are here

protected function EntityTranslationDefaultHandler::translationTabSort in Entity Translation 7

Helper callback. Sorts language tabs by weight.

File

includes/translation.handler.inc, line 1697
Default translation handler for the translation module.

Class

EntityTranslationDefaultHandler
Class implementing the default entity translation behaviours.

Code

protected function translationTabSort($a, $b) {
  if ($a['#link']['weight'] == $b['#link']['weight']) {
    return 0;
  }
  else {
    return $a['#link']['weight'] > $b['#link']['weight'] ? 1 : -1;
  }
}