Advertisement
DrupalCustom

no args

Feb 16th, 2012
354
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.96 KB | None | 0 0
  1. function _ajax_example_get_second_dropdown_options_langs($key = ''){
  2.   global $finalFunctionUserName;
  3.   global $finalFunctionPassword;
  4.  
  5.   $LoginClient = new SoapClient("https://freeway.demo.lionbridge.com/vojo/FreewayAuth.asmx?wsdl", array("trace" => 1));
  6.   $ServicesLink = new SoapClient("https://freeway.demo.lionbridge.com/vojo/Service.asmx?wsdl", array("trace" => 1));
  7.  
  8.   try {
  9.  
  10.     $arrResponse = $LoginClient->Logon(array('Username' => $finalFunctionUserName, 'Password' => $finalFunctionPassword));
  11.  
  12.     $ticket = ($arrResponse->LogonResult);
  13.     $getSrcLang = $ServicesLink->GetSourceLanguages(array('Ticket' => $ticket));
  14.     $getDraftProjectIds = $ServicesLink->GetProjectSummariesList(array('Ticket' => $ticket, 'NumberOfProjects' => 100, 'SortOrder' => MostRecent, 'ProjectStatusCode' => 'Draft'));
  15.  
  16.     $array = array();  
  17.     $forTarLang = array();
  18.     $arrayT = array();
  19.    
  20.    
  21.     foreach ($getSrcLang->GetSourceLanguagesResult->Languages->Language as $language) {
  22.       $array[$language->ID] = $language->Description . "_" . $language->ID;
  23.       $forTarLang[] = $language->ID;
  24.     }
  25.  
  26.   }
  27.   catch (SoapFault $exception) {
  28.     drupal_get_messages();
  29.     drupal_set_message("The following exception took place." . $exception . "Kindly check Freeway mapping");
  30.     drupal_goto("user");
  31.  
  32.  
  33.   }
  34.  
  35.     try {
  36.  
  37.     if (count($forTarLang) != 0) {
  38.       $getTarLang = $ServicesLink->GetTargetLanguages(array('Ticket' => $ticket, 'SourceLanguageID' => $forTarLang[0]));
  39.  
  40.       foreach ($getTarLang->GetTargetLanguagesResult->Languages->Language as $languageT) {
  41.         //$arrayT[$languageT->ID] = $languageT->Description;
  42.         $arrayT[$languageT->ID] = $languageT->Description . "_" . $languageT->ID;
  43.       }
  44.     }
  45.   }
  46.   catch (Exception  $exception1) {
  47.     drupal_get_messages();
  48.     drupal_set_message("The following exception took place." . $exception1);
  49.     drupal_goto("user");
  50.  
  51.   }
  52.  
  53.  
  54.  
  55.  
  56.  
  57.   return drupal_map_assoc($arrayT);
  58.  
  59.  
  60. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement