You are here

function _webform_components_sort in Webform 5.2

Same name and namespace in other branches
  1. 5 webform.module \_webform_components_sort()
  2. 6.3 webform.module \_webform_components_sort()
  3. 6.2 webform.module \_webform_components_sort()
  4. 7.4 webform.module \_webform_components_sort()
  5. 7.3 webform.module \_webform_components_sort()

Helper for the uasort in webform_tree_sort()

1 string reference to '_webform_components_sort'
_webform_components_tree_sort in ./webform.module
Sort each level of a component tree by weight and name

File

./webform.module, line 2344

Code

function _webform_components_sort($a, $b) {
  if ($a['weight'] == $b['weight']) {
    return strcasecmp($a['name'], $b['name']);
  }
  return $a['weight'] < $b['weight'] ? -1 : 1;
}