本文整理汇总了PHP中getCurrentLangName函数的典型用法代码示例。如果您正苦于以下问题:PHP getCurrentLangName函数的具体用法?PHP getCurrentLangName怎么用?PHP getCurrentLangName使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getCurrentLangName函数的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getSwitcherLanguage
function getSwitcherLanguage()
{
$sContent = '';
$iLangsCount = count(getLangsArr());
if ($iLangsCount <= 1) {
return '';
}
$sLangName = getCurrentLangName();
$aTmplVars = array();
$aTmplVars[] = array('caption' => _t('_sys_bm_language', $sLangName), 'link' => 'javascript:void(0)', 'script' => 'onclick="javascript:showPopupLanguage()"', 'target' => '');
$sContent .= $GLOBALS['oSysTemplate']->parseHtmlByName('extra_' . $this->sName . '_menu.html', array('bx_repeat:items' => $aTmplVars));
$sContent .= $GLOBALS['oFunctions']->getLanguageSwitcher($sLangName);
return $sContent;
}
示例2: getTopMenu
public static function getTopMenu()
{
$sTmplVarsAddons = '';
$aTmplVarsItems = array();
$aItems = array();
if (count(getLangsArr()) > 1) {
$aItems[] = array('caption' => '_adm_tmi_language', 'url' => 'javascript:void(0)', 'onclick' => 'showPopupLanguage()', 'target' => '', 'icon' => 'language');
$sLangName = getCurrentLangName();
$sTmplVarsAddons .= $GLOBALS['oFunctions']->getLanguageSwitcher($sLangName);
}
$aItems = array_merge($aItems, $GLOBALS['MySQL']->getAll("SELECT `caption`, `url`, `target`, `icon` FROM `sys_menu_admin_top` ORDER BY `Order`"));
foreach ($aItems as $aItem) {
$aTmplVarsItems[] = array('caption' => _t($aItem['caption']), 'url' => str_replace(array('{site_url}', '{admin_url}'), array($GLOBALS['site']['url'], $GLOBALS['site']['url_admin']), $aItem['url']), 'target' => !empty($aItem['target']) ? $aItem['target'] : '_self', 'bx_if:show_onclick' => array('condition' => isset($aItem['onclick']) && !empty($aItem['onclick']), 'content' => array('onclick' => isset($aItem['onclick']) ? $aItem['onclick'] : '')), 'icon' => false === strpos($aItem['icon'], '.') ? '<i class="sys-icon ' . $aItem['icon'] . '"></i>' : '<img src="' . $GLOBALS['oAdmTemplate']->getIconUrl($aItem['icon']) . '" alt="' . _t($aItem['caption']) . '" />');
}
return $GLOBALS['oAdmTemplate']->parseHtmlByName('top_menu.html', array('bx_repeat:items' => $aTmplVarsItems, 'addons' => $sTmplVarsAddons));
}
示例3: uninstall
function uninstall($aParams)
{
$aResult = parent::uninstall($aParams);
if ($aResult['result']) {
$bInclude = @(include $this->sFilePath);
if (!$bInclude || empty($LANG) || empty($LANG_INFO) || !$this->_removeLanguage($LANG, $LANG_INFO)) {
return array('operation_title' => _t('_adm_txt_modules_operation_install', $this->_aConfig['title']), 'message' => 'Language file parse error: ' . $this->sFileName, 'result' => false);
}
// delete compiled lang file
@unlink(BX_DIRECTORY_PATH_ROOT . "langs/lang-{$LANG_INFO['Name']}.php");
$GLOBALS['MySQL']->cleanCache('checkLangExists_' . $LANG_INFO['Name']);
if (bx_lang_name() == $LANG_INFO['Name']) {
getCurrentLangName(true);
}
}
return $aResult;
}
示例4: createProfile
function createProfile($aData, $bSendMails = true, $iMainMemberID = 0)
{
if (!$aData or !is_array($aData) or empty($aData)) {
return false;
}
unset($aData['Couple']);
unset($aData['Captcha']);
unset($aData['TermsOfUse']);
unset($aData['ProfilePhoto']);
/* @var $this ->oPF BxDolProfileFields */
$this->oPF = new BxDolProfileFields(100);
if (!$this->oPF->aArea) {
echo 'Profile Fields cache not loaded. Cannot continue.';
return false;
}
$this->aItems = $this->oPF->aArea[0]['Items'];
if ($iMainMemberID) {
$aMainMember = $this->getProfileInfo($iMainMemberID);
} else {
$aMainMember = false;
}
// begin profile info collecting
$aNewProfile = array();
foreach ($this->aItems as $aItem) {
$sItemName = $aItem['Name'];
if (array_key_exists($sItemName, $aData)) {
$aNewProfile[$sItemName] = $aData[$sItemName];
} elseif ($aMainMember and array_key_exists($sItemName, $aMainMember) and $aItem['Type'] != 'system') {
if ($aItem['Unique']) {
$aNewProfile[$sItemName] = $this->genUniqueValue($sItemName, $aMainMember[$sItemName]);
} else {
$aNewProfile[$sItemName] = $aMainMember[$sItemName];
}
} else {
switch ($aItem['Type']) {
case 'pass':
$aNewProfile[$sItemName] = $this->genRandomPassword();
break;
case 'num':
$aNewProfile[$sItemName] = (int) $aItem['Default'];
break;
case 'bool':
$aNewProfile[$sItemName] = (bool) $aItem['Default'];
break;
case 'system':
switch ($sItemName) {
case 'ID':
//set automatically
//set automatically
case 'Captcha':
//not been inserted
//not been inserted
case 'Location':
//not been inserted
//not been inserted
case 'Keyword':
//not been inserted
//not been inserted
case 'TermsOfUse':
//not been inserted
//pass
break;
case 'DateReg':
$aNewProfile[$sItemName] = date('Y-m-d H:i:s');
// set current date
break;
case 'DateLastEdit':
case 'DateLastLogin':
$aNewProfile[$sItemName] = '0000-00-00';
break;
case 'Couple':
$aNewProfile[$sItemName] = $aMainMember ? $iMainMemberID : 0;
//if main member exists, set him as a couple link
break;
case 'Featured':
$aNewProfile[$sItemName] = false;
break;
case 'Status':
if (getParam('autoApproval_ifNoConfEmail') == 'on') {
if (getParam('autoApproval_ifJoin') == 'on' && !(getParam('sys_dnsbl_enable') && 'approval' == getParam('sys_dnsbl_behaviour') && bx_is_ip_dns_blacklisted('', 'join'))) {
$aNewProfile[$sItemName] = 'Active';
} else {
$aNewProfile[$sItemName] = 'Approval';
}
} else {
$aNewProfile[$sItemName] = 'Unconfirmed';
}
break;
}
break;
default:
$aNewProfile[$sItemName] = $aItem['Default'];
}
}
}
//we completed collecting
// set default language
$aNewProfile['LangID'] = getLangIdByName(getCurrentLangName());
// set default privacy
bx_import('BxDolPrivacyQuery');
//.........这里部分代码省略.........
示例5: setLanguage
function setLanguage($sLang)
{
if ('English' == $sLang || !preg_match('/^[a-zA-Z]+$/', $sLang)) {
$sLang = 'en';
}
$_GET['lang'] = $sLang;
$sCurrentLanguage = getCurrentLangName();
global $LANG;
require_once BX_DIRECTORY_PATH_ROOT . "langs/lang-{$sCurrentLanguage}.php";
}
示例6: getExtraFiles
/**
* get extra files list for given module
*
* @param $sModule - module name
* @param $sFolder - folder name where to look for files
* @param $bGetUserFile - get current user file (true) or default file (false)
* @param $bGetDate - get dates of files
* @return $aResult - files array without extension and/or current file
*/
function getExtraFiles($sModule, $sFolder = "langs", $bGetUserFile = true, $bGetDate = false)
{
global $sModulesPath;
$sFilesPath = $sModulesPath . $sModule . "/" . $sFolder . "/";
$aFiles = array();
$aDates = array();
$sExtension = getFileExtension($sModule, $sFolder);
if ($bGetDate) {
clearstatcache();
}
if ($sFolder == "langs") {
$sSysLang = getCurrentLangName(false);
} else {
$aResult = getSettingValue($sModule, FILE_DEFAULT_KEY, $sFolder, true);
if ($aResult['status'] == FAILED_VAL || empty($aResult['value'])) {
$sDefaultFile = $sFolder == "langs" ? "english" : "default";
} else {
$sDefaultFile = $aResult['value'];
}
}
if ($rDirHandle = opendir($sFilesPath)) {
while (false !== ($sFile = readdir($rDirHandle))) {
if (is_file($sFilesPath . $sFile) && $sFile != "." && $sFile != ".." && $sExtension == substr($sFile, strpos($sFile, ".") + 1)) {
$aFiles[] = substr($sFile, 0, strpos($sFile, "."));
if ($bGetDate) {
$aDates[] = filectime($sFilesPath . $sFile);
}
if ($sFolder == "langs" && $sSysLang == substr($sFile, 0, 2)) {
$sDefaultFile = substr($sFile, 0, strpos($sFile, "."));
}
}
}
}
closedir($rDirHandle);
$sCurrentFile = in_array($sDefaultFile, $aFiles) ? $sDefaultFile : $aFiles[0];
if ($bGetUserFile) {
$sCookieValue = $_COOKIE["ray_" . $sFolder . "_" . $sModule];
$sCurrentFile = isset($sCookieValue) && in_array($sCookieValue, $aFiles) ? $sCookieValue : $sCurrentFile;
}
return array('files' => $aFiles, 'dates' => $aDates, 'current' => $sCurrentFile, 'extension' => $sExtension);
}
示例7: getCacheKey
/**
* Generate name for cache
*
* @param $iProfileId integer
* @return string
*/
function getCacheKey($iProfileId)
{
global $site;
return $this->sMenuMemberKeysCache . $iProfileId . '_' . md5($site['ver'] . $site['build'] . $site['url'] . getCurrentLangName(false) . $GLOBALS['oSysTemplate']->getCode()) . '.php';
}
示例8: genBlocksCacheKey
function genBlocksCacheKey($sId)
{
global $site;
return 'pb_' . $sId . '_' . md5($site['ver'] . $site['build'] . $site['url'] . getCurrentLangName(false) . $GLOBALS['oSysTemplate']->getCode()) . '.php';
}
示例9: _getCacheFileName
/**
* Get file name where the template would be cached.
*
* @param string $sAbsolutePath template's real path.
* @return string the result of operation.
*/
function _getCacheFileName($sType, $sAbsolutePath)
{
$sResult = md5($sAbsolutePath . $GLOBALS['site']['ver'] . $GLOBALS['site']['build'] . $GLOBALS['site']['url']);
switch ($sType) {
case 'html':
$sResult = $this->_sCacheFilePrefix . getCurrentLangName() . '_' . $this->_sCode . '_' . $sResult;
break;
case 'css':
$sResult = $this->_sCssCachePrefix . $sResult;
break;
case 'js':
$sResult = $this->_sJsCachePrefix . $sResult;
break;
}
return $sResult;
}
示例10: define
define('BX_DOL_LANGUAGE_DEFAULT', 'en');
define('BX_DOL_LANGUAGE_CATEGORY_SYSTEM', 1);
if (!defined('BX_SKIP_INSTALL_CHECK')) {
$sCurrentLanguage = getCurrentLangName(false);
if (!$sCurrentLanguage) {
echo '<br /><b>Fatal error:</b> Cannot apply localization.';
exit;
}
require_once BX_DIRECTORY_PATH_ROOT . "langs/lang-{$sCurrentLanguage}.php";
}
require_once BX_DIRECTORY_PATH_INC . 'db.inc.php';
require_once BX_DIRECTORY_PATH_INC . 'utils.inc.php';
require_once BX_DIRECTORY_PATH_INC . 'profiles.inc.php';
require_once BX_DIRECTORY_PATH_INC . 'params.inc.php';
if (!defined('BX_SKIP_INSTALL_CHECK')) {
getCurrentLangName(true);
if (isset($_GET['lang'])) {
bx_import('BxDolPermalinks');
$oPermalinks = new BxDolPermalinks();
if ($oPermalinks->redirectIfNecessary(array('lang'))) {
exit;
}
}
}
function getCurrentLangName($isSetCookie = true)
{
$sLang = '';
if (!$sLang && !empty($_GET['lang'])) {
$sLang = tryToGetLang($_GET['lang'], $isSetCookie);
}
if (!$sLang && !empty($_POST['lang'])) {
示例11: define
* This file is part of Dolphin - Smart Community Builder
*
* Dolphin is free software. This work is licensed under a Creative Commons Attribution 3.0 License.
* http://creativecommons.org/licenses/by/3.0/
*
* Dolphin is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the Creative Commons Attribution 3.0 License for more details.
* You should have received a copy of the Creative Commons Attribution 3.0 License along with Dolphin,
* see license.txt file; if not, write to marketing@boonex.com
***************************************************************************/
require_once 'header.inc.php';
require_once 'db.inc.php';
require_once 'utils.inc.php';
define('LANGUAGE_CATEGORY_ID_PROFILE_FIELDS', 24);
$sCurrentLanguage = getCurrentLangName();
if (!$sCurrentLanguage) {
echo '<br /><b>Fatal error:</b> Cannot apply localization.';
exit;
}
require_once "{$dir['root']}langs/lang-{$sCurrentLanguage}.php";
function getCurrentLangName()
{
$sLang = '';
if (!$sLang) {
$sLang = tryToGetLang($_GET['lang'], true);
}
if (!$sLang) {
$sLang = tryToGetLang($_POST['lang'], true);
}
if (!$sLang) {