You are here

function lingotek_get_communities_v4 in Lingotek Translation 7.3

Same name and namespace in other branches
  1. 7.2 lingotek.setup.inc \lingotek_get_communities_v4()
2 calls to lingotek_get_communities_v4()
lingotek_community_select_form in ./lingotek.setup.inc
Community Select Screen (for Current Users) - Form
lingotek_setup_account_settings_form_submit in ./lingotek.setup.inc
Account Settings (for Current Users) - Form Processing

File

./lingotek.setup.inc, line 960

Code

function lingotek_get_communities_v4($login, $passwd, $url) {

  // API V4 Connection
  $client = new LingotekSession();
  $client->login_id = $login;
  $client->password = $passwd;
  $client->url = $url;
  $options = array();
  if (!$client
    ->canLogIn()) {
    return FALSE;
  }
  $list_communities = $client
    ->request("listCommunities", array());
  if ($list_communities->results == "success") {
    foreach ($list_communities->communities as $community) {
      $options[$community->id] = $community->name;
    }
  }
  return $options;
}