コード例 #1
0
 /**
  * Fetch data from the language pack
  *
  * @param    string    $sText    The text to fech
  * @return    string
  */
 public function fetchFromLanguagePack($sText)
 {
     if ($this != null && $this->sLangISO != null) {
         $sISO = strtolower($this->sLangISO);
     } else {
         $sISO = KlarnaAPI::getISOCode();
     }
     $oXml = simplexml_load_file($this->sPath . '/klarna_files/klarna_language.xml');
     $aResult = (array) @$oXml->xpath("//string[@id='{$sText}']/{$sISO}");
     $aResult = (array) @$aResult[0];
     return @$aResult[0];
 }
コード例 #2
0
ファイル: klarnaapi.php プロジェクト: cybershocik/Darek
 /**
  * Fetch data from the language pack
  *
  * @param    string    $sText    The text to fech
  * @param null         $sISO
  * @param null         $sPath
  * @return    string
  * @deprecated
  */
 public function fetchFromLanguagePack($sText, $sISO = NULL, $sPath = NULL)
 {
     if ($sISO == NULL) {
         if ($this != NULL && $this->sLangISO != NULL) {
             $sISO = strtolower($this->sLangISO);
         } else {
             $sISO = KlarnaAPI::getISOCode();
         }
     } else {
         $sISO = KlarnaAPI::getISOCode($sISO);
     }
     if ($this->sPath != NULL) {
         $sPath = $this->sPath;
     }
     if ($this->languagePack == NULL) {
         $this->languagePack = new KlarnaLanguagePack(JPATH_VMKLARNAPLUGIN . '/klarna/language/klarna_language.xml');
     }
     return $this->languagePack->fetch($sText, $sISO);
 }