/** * @param Exception $oException * @param bool $bLog = true */ protected function setLastException(Exception $oException, $bLog = true) { $this->oLastException = $oException; if ($bLog) { $sFile = str_replace(str_replace('\\', '/', strtolower(realpath(CApi::WebMailPath()))), '~ ', str_replace('\\', '/', strtolower($oException->getFile()))); CApi::Log('Exception[' . $oException->getCode() . ']: ' . $oException->getMessage() . API_CRLF . $sFile . ' (' . $oException->getLine() . ')' . API_CRLF . '----------------------------------------------------------------------' . API_CRLF . $oException->getTraceAsString(), ELogLevel::Error); } }
/** * @return array */ public function getThemeList() { static $sList = null; if (null === $sList) { $sList = array(); $aThemes = CApi::GetConf('themes', array()); $sDir = CApi::WebMailPath() . 'skins'; if (is_array($aThemes)) { foreach ($aThemes as $sTheme) { if (file_exists($sDir . '/' . $sTheme . '/styles.css')) { $sList[] = $sTheme; } } } } return $sList; }
/** * @return array */ public function GetSkinList() { $sList = array(); $sDir = CApi::WebMailPath() . 'skins'; if (@is_dir($sDir)) { $rDirH = @opendir($sDir); if ($rDirH) { while (($sFile = @readdir($rDirH)) !== false) { if ('.' !== $sFile[0] && @file_exists($sDir . '/' . $sFile . '/styles.css')) { $sList[] = $sFile; } } @closedir($rDirH); } } return $sList; }
/** * @param string $sData * @param CAccount $oAccount * @param array $aParams = null * * @return string */ public static function ClientI18N($sData, $oAccount = null, $aParams = null, $iPluralCount = null) { // TODO: $sLanguage = ''; if (empty($sLanguage)) { $oSettings =& \CApi::GetSettings(); $sLanguage = $oSettings->GetConf('DefaultLanguage'); } $aLang = null; if (isset(CApi::$aClientI18N[$sLanguage])) { $aLang = CApi::$aClientI18N[$sLanguage]; } else { CApi::$aClientI18N[$sLanguage] = false; $sLangFile = CApi::WebMailPath() . 'i18n/' . $sLanguage . '.ini'; if (!@file_exists($sLangFile)) { $sLangFile = CApi::WebMailPath() . 'i18n/English.ini'; $sLangFile = @file_exists($sLangFile) ? $sLangFile : ''; } if (0 < strlen($sLangFile)) { $aLang = self::convertIniToLang($sLangFile); if (is_array($aLang)) { CApi::$aClientI18N[$sLanguage] = $aLang; } } } //return self::processTranslateParams($aLang, $sData, $aParams); return isset($iPluralCount) ? self::processTranslateParams($aLang, $sData, $aParams, self::getPlural($sLanguage, $iPluralCount)) : self::processTranslateParams($aLang, $sData, $aParams); }