本文整理汇总了PHP中api_Utils::ConvertLanguageNameToShort方法的典型用法代码示例。如果您正苦于以下问题:PHP api_Utils::ConvertLanguageNameToShort方法的具体用法?PHP api_Utils::ConvertLanguageNameToShort怎么用?PHP api_Utils::ConvertLanguageNameToShort使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类api_Utils
的用法示例。
在下文中一共展示了api_Utils::ConvertLanguageNameToShort方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: appDataUserSettings
/**
* @param CAccount $oAccount
*
* @return array
*/
private function appDataUserSettings($oAccount)
{
$aResult = array();
if ($oAccount) {
$oSettings =& CApi::GetSettings();
$oApiCapabilityManager = CApi::Manager('capability');
/* @var $oApiCapabilityManager CApiCapabilityManager */
$aResult['IdUser'] = $oAccount->User->IdUser;
$aResult['MailsPerPage'] = (int) $oAccount->User->MailsPerPage;
$aResult['ContactsPerPage'] = (int) $oAccount->User->ContactsPerPage;
$aResult['AutoCheckMailInterval'] = (int) $oAccount->User->AutoCheckMailInterval;
$aResult['DefaultEditor'] = (int) $oAccount->User->DefaultEditor;
$aResult['Layout'] = 0;
$aResult['LoginsCount'] = $oAccount->User->LoginsCount;
$aResult['CanLoginWithPassword'] = $oAccount->canLoginWithPassword();
if ($oAccount->User->LoginsCount === 1) {
$oApiSocialManager = CApi::Manager('social');
$aSocials = $oApiSocialManager->getSocials($oAccount->IdAccount);
if (count($aSocials) > 0) {
$aResult['SocialName'] = $aSocials[0]->Name;
}
}
$aResult['DefaultTheme'] = $oAccount->User->DefaultSkin;
$aResult['DefaultLanguage'] = $oAccount->User->DefaultLanguage;
$aResult['DefaultLanguageShort'] = api_Utils::ConvertLanguageNameToShort($oAccount->User->DefaultLanguage);
$aResult['DefaultDateFormat'] = $oAccount->User->DefaultDateFormat;
$aResult['DefaultTimeFormat'] = $oAccount->User->DefaultTimeFormat;
$aResult['AllowCompose'] = (bool) $oAccount->AllowCompose;
$aResult['AllowReply'] = (bool) $oAccount->AllowReply;
$aResult['AllowForward'] = (bool) $oAccount->AllowForward;
$aFetcherDomains = CApi::GetConf('labs.fetchers.domains', array());
$aResult['AllowFetcher'] = CApi::GetConf('labs.fetchers', false) && ($oAccount->Domain->IsInternal || \in_array($oAccount->IncomingMailServer, $aFetcherDomains));
$iSaveMail = $oSettings->GetConf('WebMail/SaveMail');
$iSaveMail = ESaveMail::Always !== $iSaveMail ? $oAccount->User->SaveMail : ESaveMail::Always;
$aResult['SaveMail'] = (int) $iSaveMail;
$aResult['ThreadsEnabled'] = !!$oAccount->Domain->UseThreads;
$aResult['UseThreads'] = false;
$aResult['SaveRepliedMessagesToCurrentFolder'] = false;
$aResult['DesktopNotifications'] = (bool) $oAccount->User->DesktopNotifications;
$aResult['AllowChangeInputDirection'] = (bool) $oAccount->User->AllowChangeInputDirection;
$aResult['EnableOpenPgp'] = (bool) $oAccount->User->EnableOpenPgp;
$aResult['AllowAutosaveInDrafts'] = (bool) $oAccount->User->AllowAutosaveInDrafts;
$aResult['AutosignOutgoingEmails'] = (bool) $oAccount->User->AutosignOutgoingEmails;
$aResult['EmailNotification'] = !empty($oAccount->User->EmailNotification) ? $oAccount->User->EmailNotification : $oAccount->Email;
if ($aResult['ThreadsEnabled']) {
$aResult['UseThreads'] = (bool) $oAccount->User->UseThreads;
$aResult['SaveRepliedMessagesToCurrentFolder'] = (bool) $oAccount->User->SaveRepliedMessagesToCurrentFolder;
}
$aResult['OutlookSyncEnable'] = $oApiCapabilityManager->isOutlookSyncSupported($oAccount);
$aResult['MobileSyncEnable'] = $oApiCapabilityManager->isMobileSyncSupported($oAccount);
$aResult['ShowPersonalContacts'] = $oApiCapabilityManager->isPersonalContactsSupported($oAccount);
$aResult['ShowGlobalContacts'] = $oApiCapabilityManager->isGlobalContactsSupported($oAccount, true);
$aResult['IsCollaborationSupported'] = $oApiCapabilityManager->isCollaborationSupported();
$aResult['AllowFilesSharing'] = (bool) CApi::GetConf('labs.files-sharing', false);
$aResult['IsFilesSupported'] = $oApiCapabilityManager->isFilesSupported($oAccount);
$aResult['IsHelpdeskSupported'] = $oApiCapabilityManager->isHelpdeskSupported($oAccount);
$aResult['IsHelpdeskAgent'] = $aResult['IsHelpdeskSupported'];
// TODO
$aResult['AllowHelpdeskNotifications'] = (bool) $oAccount->User->AllowHelpdeskNotifications;
$aResult['HelpdeskSignature'] = (string) $oAccount->User->HelpdeskSignature;
$aResult['HelpdeskSignatureEnable'] = (bool) $oAccount->User->HelpdeskSignatureEnable;
$aResult['LastLogin'] = 0;
if ($oSettings->GetConf('WebMail/EnableLastLoginNotification')) {
$aResult['LastLogin'] = $oAccount->User->LastLogin;
}
$aResult['AllowVoice'] = false;
$aResult['VoiceProvider'] = '';
$aResult['SipRealm'] = '';
$aResult['SipWebsocketProxyUrl'] = '';
$aResult['SipOutboundProxyUrl'] = '';
$aResult['SipCallerID'] = '';
$aResult['TwilioNumber'] = '';
$aResult['TwilioEnable'] = true;
$aResult['SipEnable'] = true;
$aResult['SipImpi'] = '';
$aResult['SipPassword'] = '';
$aResult['FilesEnable'] = $oAccount->User->FilesEnable;
$oApiTenants = CApi::Manager('tenants');
/* @var $oApiTenants CApiTenantsManager */
if ($oApiTenants) {
$oTenant = 0 < $oAccount->IdTenant ? $oApiTenants->getTenantById($oAccount->IdTenant) : $oApiTenants->getDefaultGlobalTenant();
if ($oTenant) {
if ($oTenant->SipAllowConfiguration && $oTenant->SipAllow && $oTenant->isSipSupported() && $oApiCapabilityManager->isSipSupported($oAccount)) {
$aResult['AllowVoice'] = $oTenant->SipAllow;
if ($aResult['AllowVoice']) {
$aResult['AllowVoice'] = $oAccount->User->SipEnable;
}
$aResult['VoiceProvider'] = 'sip';
$aResult['SipRealm'] = (string) $oTenant->SipRealm;
$aResult['SipWebsocketProxyUrl'] = (string) $oTenant->SipWebsocketProxyUrl;
$aResult['SipOutboundProxyUrl'] = (string) $oTenant->SipOutboundProxyUrl;
$aResult['SipCallerID'] = (string) $oTenant->SipCallerID;
$aResult['SipEnable'] = $oAccount->User->SipEnable;
$aResult['SipImpi'] = $oAccount->User->SipImpi;
$aResult['SipPassword'] = $oAccount->User->SipPassword;
//.........这里部分代码省略.........
示例2: getMomentLanguageString
private function getMomentLanguageString($sLanguage)
{
$sMomentLanguage = api_Utils::ConvertLanguageNameToShort($sLanguage);
if ($sLanguage === 'Arabic' || $sLanguage === 'Persian') {
$sMoment = 'window.moment && window.moment.locale && window.moment.locale(\'en\');';
} else {
$sMoment = 'window.moment && window.moment.locale && window.moment.locale(\'' . $sMomentLanguage . '\');';
}
}