Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function _ajax_example_get_second_dropdown_options_langs($key = ''){
- global $finalFunctionUserName;
- global $finalFunctionPassword;
- $LoginClient = new SoapClient("https://freeway.demo.lionbridge.com/vojo/FreewayAuth.asmx?wsdl", array("trace" => 1));
- $ServicesLink = new SoapClient("https://freeway.demo.lionbridge.com/vojo/Service.asmx?wsdl", array("trace" => 1));
- try {
- $arrResponse = $LoginClient->Logon(array('Username' => $finalFunctionUserName, 'Password' => $finalFunctionPassword));
- $ticket = ($arrResponse->LogonResult);
- $getSrcLang = $ServicesLink->GetSourceLanguages(array('Ticket' => $ticket));
- $getDraftProjectIds = $ServicesLink->GetProjectSummariesList(array('Ticket' => $ticket, 'NumberOfProjects' => 100, 'SortOrder' => MostRecent, 'ProjectStatusCode' => 'Draft'));
- $array = array();
- $forTarLang = array();
- $arrayT = array();
- foreach ($getSrcLang->GetSourceLanguagesResult->Languages->Language as $language) {
- $array[$language->ID] = $language->Description . "_" . $language->ID;
- $forTarLang[] = $language->ID;
- }
- }
- catch (SoapFault $exception) {
- drupal_get_messages();
- drupal_set_message("The following exception took place." . $exception . "Kindly check Freeway mapping");
- drupal_goto("user");
- }
- try {
- if (count($forTarLang) != 0) {
- $getTarLang = $ServicesLink->GetTargetLanguages(array('Ticket' => $ticket, 'SourceLanguageID' => $forTarLang[0]));
- foreach ($getTarLang->GetTargetLanguagesResult->Languages->Language as $languageT) {
- //$arrayT[$languageT->ID] = $languageT->Description;
- $arrayT[$languageT->ID] = $languageT->Description . "_" . $languageT->ID;
- }
- }
- }
- catch (Exception $exception1) {
- drupal_get_messages();
- drupal_set_message("The following exception took place." . $exception1);
- drupal_goto("user");
- }
- return drupal_map_assoc($arrayT);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement