You are here

function lingotek_get_communities in Lingotek Translation 6

Same name and namespace in other branches
  1. 7.2 lingotek.api.inc \lingotek_get_communities()
  2. 7.3 lingotek.api.inc \lingotek_get_communities()
  3. 7.4 lingotek.api.inc \lingotek_get_communities()
  4. 7.5 lingotek.remote.inc \lingotek_get_communities()
  5. 7.6 lingotek.remote.inc \lingotek_get_communities()
3 calls to lingotek_get_communities()
lingotek_administrative_settings_form in ./lingotek.admin.inc
lingotek_admin_form in ./lingotek.admin.inc
lingotek_community_form in ./lingotek.admin.inc

File

./lingotek.api.inc, line 225

Code

function lingotek_get_communities() {
  global $_lingotek_client;
  $options = array();
  if (!$_lingotek_client
    ->canLogIn()) {
    return $options;
  }
  $list_communities = $_lingotek_client
    ->request("listCommunities", array());
  if ($list_communities->results == "success") {
    foreach ($list_communities->communities as $community) {
      $options[$community->id] = t($community->name);
    }
  }
  return $options;
}