You are here

function lingotek_load_profile_defaults in Lingotek Translation 7.7

Same name and namespace in other branches
  1. 7.4 lingotek.util.inc \lingotek_load_profile_defaults()
  2. 7.5 lingotek.util.inc \lingotek_load_profile_defaults()
  3. 7.6 lingotek.util.inc \lingotek_load_profile_defaults()

Gets the default profile info, mapped by entity type

1 call to lingotek_load_profile_defaults()
lingotek_profile_condition in ./lingotek.util.inc

File

./lingotek.util.inc, line 1739
Utility functions.

Code

function lingotek_load_profile_defaults($entity_type) {
  $profile_defaults = lingotek_get_profiles(FALSE);
  $entity_profile_defaults = variable_get('lingotek_entity_profiles', array());
  $profile_map = array();
  if (array_key_exists($entity_type, $entity_profile_defaults)) {
    foreach ($entity_profile_defaults[$entity_type] as $k => $v) {
      $profile_map[$k] = is_numeric($v) && !empty($profile_defaults[$v]) ? $profile_defaults[$v] : array();
      $profile_map[$k]['profile'] = $v;
      unset($profile_map[$k]['name']);
    }
    return $profile_map;
  }
  return array();
}