You are here

function lingotek_get_vault_name in Lingotek Translation 7.7

Return value

string The name of the vault currently in use

1 call to lingotek_get_vault_name()
lingotek_admin_account_status_form in ./lingotek.admin.inc
Form constructor for the administration form.

File

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

Code

function lingotek_get_vault_name() {
  $vault_defaults = LingotekApi::instance()
    ->listVaults();
  $vault_id = variable_get('lingotek_vault', '');
  if (empty($vault_defaults)) {
    return '';
  }
  foreach ($vault_defaults as $vault_type) {
    if (isset($vault_type[$vault_id])) {
      return $vault_type[$vault_id];
    }
  }
  $vaults_reponse = LingotekApi::instance()
    ->listVaults(TRUE, TRUE);
  foreach ($vaults_reponse as $vault_class) {
    foreach ($vault_class as $key => $vault_name) {
      if ("{$key}" === "{$vault_id}") {
        return $vault_name;
      }
    }
  }
  return '';
}