Beispiel #1
0
 /**
  * @param string $sSettingsPath
  *
  * @return api_Settings
  */
 public function __construct($sSettingsPath)
 {
     $this->aMap = array();
     $this->aLowerMap = array();
     $this->aContainer = array();
     $this->sPath = $sSettingsPath;
     $this->initDefaultValues();
     if (!$this->LoadFromXml($this->sPath . api_Settings::XML_FILE_NAME)) {
         throw new CApiBaseException(Errs::Main_SettingLoadError);
     }
     if (!api_Utils::HasSslSupport()) {
         $this->SetConf('WebMail/IncomingMailUseSSL', false);
         $this->SetConf('WebMail/OutgoingMailUseSSL', false);
     }
     if (file_exists(CApi::RootPath() . 'common/lite.php')) {
         include_once CApi::RootPath() . 'common/lite.php';
     }
     $this->SetConf('WebMail/IncomingMailProtocol', EMailProtocol::IMAP4);
 }
Beispiel #2
0
 /**
  * @param string $sData
  * @param array $aParams = null
  *
  * @return string
  */
 public static function I18N($sData, $aParams = null, $sForceCustomInitialisationLang = '')
 {
     if (null === CApi::$aI18N) {
         CApi::$aI18N = false;
         if ('' !== $sForceCustomInitialisationLang) {
             $sLang = $sForceCustomInitialisationLang;
         } else {
             $sLang = CApi::GetConf('labs.i18n', '');
         }
         $sLangFile = '';
         if (0 < strlen($sLang)) {
             $sLangFile = CApi::RootPath() . 'common/i18n/' . $sLang . '.ini';
         }
         if (0 === strlen($sLangFile) || !@file_exists($sLangFile)) {
             $sLangFile = CApi::RootPath() . 'common/i18n/English.ini';
         }
         if (0 < strlen($sLangFile) && @file_exists($sLangFile)) {
             $aResultLang = self::convertIniToLang($sLangFile);
             if (is_array($aResultLang)) {
                 CApi::$aI18N = $aResultLang;
             }
         }
     }
     return self::processTranslateParams(CApi::$aI18N, $sData, $aParams);
 }