You are here

function _field_configuration_export_sort in Configuration Management 7

1 call to _field_configuration_export_sort()
field_configuration_export_render in includes/configuration.field.inc
Implements hook_configuration_export_render().

File

includes/configuration.field.inc, line 141

Code

function _field_configuration_export_sort(&$field, $sort = TRUE) {

  // Some arrays are not sorted to preserve order (for example allowed_values).
  static $sort_blacklist = array(
    'allowed_values',
  );
  if ($sort) {
    ksort($field);
  }
  foreach ($field as $k => $v) {
    if (is_array($v)) {
      _field_configuration_export_sort($field[$k], !in_array($k, $sort_blacklist));
    }
  }
}