You are here

function lingotek_get_profiles_by_name in Lingotek Translation 7.7

Same name and namespace in other branches
  1. 7.5 lingotek.module \lingotek_get_profiles_by_name()
  2. 7.6 lingotek.module \lingotek_get_profiles_by_name()

Return all profiles in an associative array, by name

2 calls to lingotek_get_profiles_by_name()
lingotek_admin_entity_bundle_profiles_form in ./lingotek.admin.inc
Content translation form
lingotek_admin_profiles_form in ./lingotek.admin.inc
1 string reference to 'lingotek_get_profiles_by_name'
lingotek_rules_condition_info in ./lingotek.rules.inc
Implements hook_rules_condition_info().

File

./lingotek.module, line 1311

Code

function lingotek_get_profiles_by_name($localize = TRUE) {
  $profile_options = array();

  // TODO: switch this lingotek_get_profiles as arrays to objects, update usage of _by_name
  $profiles = lingotek_get_profiles();
  foreach ($profiles as $key => $profile) {
    $profile_options[$key] = $localize ? t($profile
      ->getName()) : $profile
      ->getName();
  }
  $profile_options[LingotekSync::PROFILE_DISABLED] = $localize ? t('Disabled') : 'Disabled';
  $profile_options[LingotekSync::PROFILE_CONFIG] = $localize ? t('Config') : 'Config';
  return $profile_options;
}