You are here

function lingotek_get_community_name in Lingotek Translation 7.7

Return value

string The name of the current community

2 calls to lingotek_get_community_name()
LingotekApi::communityDisabledErrorMessage in lib/Drupal/lingotek/LingotekApi.php
lingotek_admin_account_status_form in ./lingotek.admin.inc
Form constructor for the administration form.

File

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

Code

function lingotek_get_community_name() {
  $community_name = variable_get('lingotek_community_name', '');
  if ($community_name === '') {
    if (!defined('lingotek_list_community_integrations')) {
      require 'lingotek.setup.inc';
    }
    $login_id = variable_get('lingotek_login_id', '');
    $password = variable_get('lingotek_password', '');
    list($success, $communities) = lingotek_list_community_integrations($login_id, $password);
    if ($success === FALSE) {
      return $community_name;
    }
    $community_id = variable_get('lingotek_community_identifier', '');
    $community_name = isset($communities[$community_id]) ? $communities[$community_id]->community_name : '';
    variable_set('lingotek_community_name', $community_name);
    return $community_name;
  }
  return $community_name;
}