You are here

function lingotek_get_profiles_by_name in Lingotek Translation 7.6

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

Return all profiles in an associative array, by name

3 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
lingotek_clear_exceptions_form in ./lingotek.module
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 1230

Code

function lingotek_get_profiles_by_name($include_custom = FALSE, $use_tfunction = TRUE) {
  $profile_options = array();
  $profiles = lingotek_get_profiles();
  foreach ($profiles as $key => $profile) {
    $profile_options[$key] = $use_tfunction ? t($profile['name']) : $profile['name'];
  }
  if ($include_custom) {
    $profile_options[LingotekSync::PROFILE_CUSTOM] = $use_tfunction ? t('Custom') : 'Custom';
  }
  $profile_options[LingotekSync::PROFILE_DISABLED] = $use_tfunction ? t('Disabled') : 'Disabled';
  $profile_options[LingotekSync::PROFILE_CONFIG] = $use_tfunction ? t('Config') : 'Config';
  return $profile_options;
}