You are here

function lingotek_get_communities in Lingotek Translation 7.5

Same name and namespace in other branches
  1. 6 lingotek.api.inc \lingotek_get_communities()
  2. 7.2 lingotek.api.inc \lingotek_get_communities()
  3. 7.3 lingotek.api.inc \lingotek_get_communities()
  4. 7.4 lingotek.api.inc \lingotek_get_communities()
  5. 7.6 lingotek.remote.inc \lingotek_get_communities()

File

./lingotek.remote.inc, line 420

Code

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