本文整理汇总了PHP中get_browser_language函数的典型用法代码示例。如果您正苦于以下问题:PHP get_browser_language函数的具体用法?PHP get_browser_language怎么用?PHP get_browser_language使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_browser_language函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setLanguage
private static function setLanguage()
{
if (!Session::get('application-language')) {
$lang = get_browser_language();
# Set the language
in_array($lang, Config::get('language')['allowed-languages']) ? Session::set('application-language', $lang) : Session::set('application-language', Config::get('language')['default-language']);
}
include_once ROOT . DS . 'app' . DS . 'languages' . DS . Session::get('application-language') . '.php';
Lang::set($marianaFrameworkLanguageArray);
}
示例2: get_best_language
/**
* @brief Returns the best language for which also a translation exists.
*
* This function takes the results from get_browser_language() and compares it
* with the available translations and returns the best fitting language for
* which there exists a translation.
*
* If there is no match fall back to config['system']['language']
*
* @return Language code in 2-letter ISO 639-1 (en).
*/
function get_best_language()
{
$langs = get_browser_language();
if (isset($langs) && count($langs)) {
foreach ($langs as $lang => $v) {
$lang = strtolower($lang);
if (file_exists("view/{$lang}") && is_dir("view/{$lang}")) {
$preferred = $lang;
break;
}
}
}
if (isset($preferred)) {
return $preferred;
}
$a = get_app();
return isset($a->config['system']['language']) ? $a->config['system']['language'] : 'en';
}
示例3: get_best_language
/**
* @brief Returns the best language for which also a translation exists.
*
* This function takes the results from get_browser_language() and compares it
* with the available translations and returns the best fitting language for
* which there exists a translation.
*
* If there is no match fall back to config['system']['language']
*
* @return Language code in 2-letter ISO 639-1 (en).
*/
function get_best_language()
{
$langs = get_browser_language();
if (isset($langs) && count($langs)) {
foreach ($langs as $lang => $v) {
$lang = strtolower($lang);
if (is_dir("view/{$lang}")) {
$preferred = $lang;
break;
}
}
}
if (!isset($preferred)) {
$preferred = 'unset';
}
$arr = array('langs' => $langs, 'preferred' => $preferred);
call_hooks('get_best_language', $arr);
if ($arr['preferred'] !== 'unset') {
return $arr['preferred'];
}
return isset(App::$config['system']['language']) ? App::$config['system']['language'] : 'en';
}
示例4: reset
<select name="admin_LANGUAGE" id="admin_language">
<?php
reset($languages);
while (list($key, $val) = each($languages)) {
echo "<option value=\"" . $val . "\"";
if ($val == $s['LANGUAGE']) {
echo " selected=\"selected\"";
}
echo ">" . $key . "</option>\n";
}
?>
</select><br />
<?php
etranslate("Your browser default language is");
echo " ";
etranslate(get_browser_language());
echo ".";
?>
</td></tr>
<tr><td class="tooltip" title="<?php
etooltip("fonts-help");
?>
">
<label for="admin_fonts"><?php
etranslate("Fonts");
?>
:</label></td><td>
<input type="text" size="40" name="admin_FONTS" id="admin_fonts" value="<?php
echo htmlspecialchars($FONTS);
?>
" />
示例5: register_user
/**
* Creates a new user.
*
* @param string $login
* @param string $password
* @param string $mail_adress
* @param bool $notify_admin
* @param array &$errors populated with error messages
* @param bool $notify_user
* @return int|false user id or false
*/
function register_user($login, $password, $mail_address, $notify_admin = true, &$errors = array(), $notify_user = false)
{
global $conf;
if ($login == '') {
$errors[] = l10n('Please, enter a login');
}
if (preg_match('/^.* $/', $login)) {
$errors[] = l10n('login mustn\'t end with a space character');
}
if (preg_match('/^ .*$/', $login)) {
$errors[] = l10n('login mustn\'t start with a space character');
}
if (get_userid($login)) {
$errors[] = l10n('this login is already used');
}
if ($login != strip_tags($login)) {
$errors[] = l10n('html tags are not allowed in login');
}
$mail_error = validate_mail_address(null, $mail_address);
if ('' != $mail_error) {
$errors[] = $mail_error;
}
if ($conf['insensitive_case_logon'] == true) {
$login_error = validate_login_case($login);
if ($login_error != '') {
$errors[] = $login_error;
}
}
$errors = trigger_change('register_user_check', $errors, array('username' => $login, 'password' => $password, 'email' => $mail_address));
// if no error until here, registration of the user
if (count($errors) == 0) {
$insert = array($conf['user_fields']['username'] => pwg_db_real_escape_string($login), $conf['user_fields']['password'] => $conf['password_hash']($password), $conf['user_fields']['email'] => $mail_address);
single_insert(USERS_TABLE, $insert);
$user_id = pwg_db_insert_id();
// Assign by default groups
$query = '
SELECT id
FROM ' . GROUPS_TABLE . '
WHERE is_default = \'' . boolean_to_string(true) . '\'
ORDER BY id ASC
;';
$result = pwg_query($query);
$inserts = array();
while ($row = pwg_db_fetch_assoc($result)) {
$inserts[] = array('user_id' => $user_id, 'group_id' => $row['id']);
}
if (count($inserts) != 0) {
mass_inserts(USER_GROUP_TABLE, array('user_id', 'group_id'), $inserts);
}
$override = array();
if ($language = get_browser_language()) {
$override['language'] = $language;
}
create_user_infos($user_id, $override);
if ($notify_admin and $conf['email_admin_on_new_user']) {
include_once PHPWG_ROOT_PATH . 'include/functions_mail.inc.php';
$admin_url = get_absolute_root_url() . 'admin.php?page=user_list&username=' . $login;
$keyargs_content = array(get_l10n_args('User: %s', stripslashes($login)), get_l10n_args('Email: %s', $mail_address), get_l10n_args(''), get_l10n_args('Admin: %s', $admin_url));
pwg_mail_notification_admins(get_l10n_args('Registration of %s', stripslashes($login)), $keyargs_content);
}
if ($notify_user and email_check_format($mail_address)) {
include_once PHPWG_ROOT_PATH . 'include/functions_mail.inc.php';
$keyargs_content = array(get_l10n_args('Hello %s,', stripslashes($login)), get_l10n_args('Thank you for registering at %s!', $conf['gallery_title']), get_l10n_args('', ''), get_l10n_args('Here are your connection settings', ''), get_l10n_args('', ''), get_l10n_args('Link: %s', get_absolute_root_url()), get_l10n_args('Username: %s', stripslashes($login)), get_l10n_args('Password: %s', stripslashes($password)), get_l10n_args('Email: %s', $mail_address), get_l10n_args('', ''), get_l10n_args('If you think you\'ve received this email in error, please contact us at %s', get_webmaster_mail_address()));
pwg_mail($mail_address, array('subject' => '[' . $conf['gallery_title'] . '] ' . l10n('Registration'), 'content' => l10n_args($keyargs_content), 'content_format' => 'text/plain'));
}
trigger_notify('register_user', array('id' => $user_id, 'username' => $login, 'email' => $mail_address));
return $user_id;
} else {
return false;
}
}
示例6: authenticate_success
function authenticate_success($user_record, $login_initial = false, $interactive = false, $login_refresh = false)
{
$a = get_app();
$_SESSION['uid'] = $user_record['uid'];
$_SESSION['theme'] = $user_record['theme'];
$_SESSION['mobile-theme'] = get_pconfig($user_record['uid'], 'system', 'mobile_theme');
$_SESSION['authenticated'] = 1;
$_SESSION['page_flags'] = $user_record['page-flags'];
$_SESSION['my_url'] = $a->get_baseurl() . '/profile/' . $user_record['nickname'];
$_SESSION['my_address'] = $user_record['nickname'] . '@' . substr($a->get_baseurl(), strpos($a->get_baseurl(), '://') + 3);
$_SESSION['addr'] = $_SERVER['REMOTE_ADDR'];
$a->user = $user_record;
if ($interactive) {
if ($a->user['login_date'] === '0000-00-00 00:00:00') {
$_SESSION['return_url'] = 'profile_photo/new';
$a->module = 'profile_photo';
info(t("Welcome ") . $a->user['username'] . EOL);
info(t('Please upload a profile photo.') . EOL);
} else {
info(t("Welcome back ") . $a->user['username'] . EOL);
}
}
$member_since = strtotime($a->user['register_date']);
if (time() < $member_since + 60 * 60 * 24 * 14) {
$_SESSION['new_member'] = true;
} else {
$_SESSION['new_member'] = false;
}
if (strlen($a->user['timezone'])) {
date_default_timezone_set($a->user['timezone']);
$a->timezone = $a->user['timezone'];
}
$master_record = $a->user;
if (x($_SESSION, 'submanage') && intval($_SESSION['submanage'])) {
$r = q("select * from user where uid = %d limit 1", intval($_SESSION['submanage']));
if (count($r)) {
$master_record = $r[0];
}
}
$r = q("SELECT `uid`,`username`,`nickname` FROM `user` WHERE `password` = '%s' AND `email` = '%s' AND `account_removed` = 0 ", dbesc($master_record['password']), dbesc($master_record['email']));
if ($r && count($r)) {
$a->identities = $r;
} else {
$a->identities = array();
}
$r = q("select `user`.`uid`, `user`.`username`, `user`.`nickname`\n\t\tfrom manage INNER JOIN user on manage.mid = user.uid where `user`.`account_removed` = 0\n\t\tand `manage`.`uid` = %d", intval($master_record['uid']));
if ($r && count($r)) {
$a->identities = array_merge($a->identities, $r);
}
if ($login_initial) {
logger('auth_identities: ' . print_r($a->identities, true), LOGGER_DEBUG);
}
if ($login_refresh) {
logger('auth_identities refresh: ' . print_r($a->identities, true), LOGGER_DEBUG);
}
$r = q("SELECT * FROM `contact` WHERE `uid` = %d AND `self` = 1 LIMIT 1", intval($_SESSION['uid']));
if (count($r)) {
$a->contact = $r[0];
$a->cid = $r[0]['id'];
$_SESSION['cid'] = $a->cid;
}
header('X-Account-Management-Status: active; name="' . $a->user['username'] . '"; id="' . $a->user['nickname'] . '"');
if ($login_initial || $login_refresh) {
$l = get_browser_language();
q("UPDATE `user` SET `login_date` = '%s', `language` = '%s' WHERE `uid` = %d", dbesc(datetime_convert()), dbesc($l), intval($_SESSION['uid']));
// Set the login date for all identities of the user
q("UPDATE `user` SET `login_date` = '%s' WHERE `password` = '%s' AND `email` = '%s' AND `account_removed` = 0", dbesc(datetime_convert()), dbesc($master_record['password']), dbesc($master_record['email']));
}
if ($login_initial) {
call_hooks('logged_in', $a->user);
if ($a->module !== 'home' && isset($_SESSION['return_url'])) {
goaway($a->get_baseurl() . '/' . $_SESSION['return_url']);
}
}
}
示例7: load_user_preferences
function load_user_preferences()
{
global $login, $browser, $views, $prefarray, $is_assistant, $has_boss, $user;
$lang_found = false;
$browser = get_web_browser();
$browser_lang = get_browser_language();
$prefarray = array();
// Note: default values are set in config.php
$res = dbi_query("SELECT cal_setting, cal_value FROM webcal_user_pref " . "WHERE cal_login = '{$login}'");
if ($res) {
while ($row = dbi_fetch_row($res)) {
$setting = $row[0];
$value = $row[1];
$sys_setting = "sys_" . $setting;
// save system defaults
if (!empty($GLOBALS[$setting])) {
$GLOBALS["sys_" . $setting] = $GLOBALS[$setting];
}
$GLOBALS[$setting] = $value;
$prefarray[$setting] = $value;
if ($setting == "LANGUAGE") {
$lang_found = true;
}
}
dbi_free_result($res);
}
// get views for this user
$res = dbi_query("SELECT cal_view_id, cal_name, cal_view_type FROM webcal_view " . "WHERE cal_owner = '{$login}'");
if ($res) {
$views = array();
while ($row = dbi_fetch_row($res)) {
$v = array("cal_view_id" => $row[0], "cal_name" => $row[1], "cal_view_type" => $row[2]);
$views[] = $v;
}
dbi_free_result($res);
}
// If user has not set a language preference, then use their browser
// settings to figure it out, and save it in the database for future
// use (email reminders).
if (!$lang_found && strlen($login) && $login != "__public__") {
$LANGUAGE = $browser_lang;
dbi_query("INSERT INTO webcal_user_pref " . "( cal_login, cal_setting, cal_value ) VALUES " . "( '{$login}', 'LANGUAGE', '{$LANGUAGE}' )");
}
if (empty($GLOBALS["DATE_FORMAT_MY"])) {
$GLOBALS["DATE_FORMAT_MY"] = "__month__ __yyyy__";
}
if (empty($GLOBALS["DATE_FORMAT_MD"])) {
$GLOBALS["DATE_FORMAT_MD"] = "__month__ __dd__";
}
$is_assistant = user_is_assistant($login, $user);
$has_boss = user_has_boss($login);
}
示例8: array
<?php
$languages = array();
$langnames = array();
// Always load English, as this will be used for defaults when the
// translations don't have anything.
include 'international/en.php';
$translations = $languages['en'];
$browser_language = get_browser_language();
$interface_language = array_key_exists("language", $prefs) ? $prefs["language"] : $browser_language;
if ($interface_language != "en") {
if (file_exists('international/' . $interface_language . '.php')) {
include 'international/' . $interface_language . '.php';
$translations = array_merge($languages['en'], $languages[$interface_language]);
} else {
debuglog("Translation " . $interface_language . " does not exist", "INTERNATIONAL");
$interface_language = "en";
}
}
function get_int_text($key, $sub = null)
{
global $translations;
if (array_key_exists($key, $translations)) {
if (is_array($sub)) {
return htmlspecialchars(vsprintf($translations[$key], $sub), ENT_QUOTES);
} else {
return htmlspecialchars($translations[$key], ENT_QUOTES);
}
} else {
debuglog("ERROR! Translation key " . $key . " not found!", "INTERNATIONAL");
return "UNKNOWN KEY";
示例9: translate
// a language so that when we send reminders (done without the benefit
// of a browser-preferred language), we'll know which language to use.
// DO let them select browser-defined for the public user or NUC.
if ($key != 'Browser-defined' || $updating_public || $is_admin || $is_nonuser_admin) {
echo '<option value="' . $val . '"';
if ($val == $prefarray['LANGUAGE']) {
echo $selected;
}
echo '>' . $key . "</option>\n";
}
}
?>
</select>
<br />
<?php
echo translate('Your browser default language is') . ' ' . translate(get_browser_language(true)) . '.';
?>
</td></tr>
</table>
</fieldset>
<fieldset>
<legend><?php
etranslate('Date and Time');
?>
</legend>
<table cellspacing="1" cellpadding="2" border="0">
<?php
if ($can_set_timezone == true) {
?>
<tr><td class="tooltipselect" title="<?php
etooltip('tz-help');
示例10: reset
<TD><SELECT NAME="admin_LANGUAGE">
<?php
reset($languages);
while (list($key, $val) = each($languages)) {
echo "<OPTION VALUE=\"" . $val . "\"";
if ($val == $LANGUAGE) {
echo " SELECTED";
}
echo "> " . $key . "\n";
}
?>
</SELECT>
<BR>
<?php
etranslate("Your browser default language is");
echo " " . get_browser_language() . ".";
?>
</TD></TR>
<TR><TD><B CLASS="tooltip" TITLE="<?php
etooltip("fonts-help");
?>
"><?php
etranslate("Fonts");
?>
:</B></TD>
<TD><INPUT SIZE="40" NAME="admin_FONTS" VALUE="<?php
echo htmlspecialchars($FONTS);
?>
" </TD></TR>
示例11: datetimesel
function datetimesel($format, $min, $max, $default, $id = 'datetimepicker', $pickdate = true, $picktime = true, $minfrom = '', $maxfrom = '', $required = false)
{
$a = get_app();
// First day of the week (0 = Sunday)
$firstDay = get_pconfig(local_user(), 'system', 'first_day_of_week');
if ($firstDay === false) {
$firstDay = 0;
}
$lang = substr(get_browser_language(), 0, 2);
// Check if the detected language is supported by the picker
if (!in_array($lang, array("ar", "ro", "id", "bg", "fa", "ru", "uk", "en", "el", "de", "nl", "tr", "fr", "es", "th", "pl", "pt", "ch", "se", "kr", "it", "da", "no", "ja", "vi", "sl", "cs", "hu"))) {
$lang = isset($a->config['system']['language']) ? $a->config['system']['language'] : 'en';
}
$o = '';
$dateformat = '';
if ($pickdate) {
$dateformat .= 'Y-m-d';
}
if ($pickdate && $picktime) {
$dateformat .= ' ';
}
if ($picktime) {
$dateformat .= 'H:i';
}
$minjs = $min ? ",minDate: new Date({$min->getTimestamp()}*1000), yearStart: " . $min->format('Y') : '';
$maxjs = $max ? ",maxDate: new Date({$max->getTimestamp()}*1000), yearEnd: " . $max->format('Y') : '';
$input_text = $default ? 'value="' . date($dateformat, $default->getTimestamp()) . '"' : '';
$defaultdatejs = $default ? ",defaultDate: new Date({$default->getTimestamp()}*1000)" : '';
$pickers = '';
if (!$pickdate) {
$pickers .= ',datepicker: false';
}
if (!$picktime) {
$pickers .= ',timepicker: false';
}
$extra_js = '';
$pickers .= ",dayOfWeekStart: " . $firstDay . ",lang:'" . $lang . "'";
if ($minfrom != '') {
$extra_js .= "\$('#{$minfrom}').data('xdsoft_datetimepicker').setOptions({onChangeDateTime: function (currentDateTime) { \$('#{$id}').data('xdsoft_datetimepicker').setOptions({minDate: currentDateTime})}})";
}
if ($maxfrom != '') {
$extra_js .= "\$('#{$maxfrom}').data('xdsoft_datetimepicker').setOptions({onChangeDateTime: function (currentDateTime) { \$('#{$id}').data('xdsoft_datetimepicker').setOptions({maxDate: currentDateTime})}})";
}
$readable_format = $dateformat;
$readable_format = str_replace('Y', 'yyyy', $readable_format);
$readable_format = str_replace('m', 'mm', $readable_format);
$readable_format = str_replace('d', 'dd', $readable_format);
$readable_format = str_replace('H', 'HH', $readable_format);
$readable_format = str_replace('i', 'MM', $readable_format);
$o .= "<div class='date'><input type='text' placeholder='{$readable_format}' name='{$id}' id='{$id}' {$input_text} />";
$o .= '</div>';
$o .= "<script type='text/javascript'>";
$o .= "\$(function () {var picker = \$('#{$id}').datetimepicker({step:5,format:'{$dateformat}' {$minjs} {$maxjs} {$pickers} {$defaultdatejs}}); {$extra_js}})";
$o .= "</script>";
return $o;
}
示例12: reset_language
function reset_language($new_language)
{
global $fullname, $lang, $lang_file, $PUBLIC_ACCESS_FULLNAME, $translation_loaded, $translations;
if ($new_language == 'none') {
$new_language = get_browser_language();
}
if ($new_language != $lang || !$translation_loaded) {
$lang = $new_language;
$lang_file = 'translations/' . $lang . '.txt';
$translation_loaded = false;
load_translation_text();
}
$PUBLIC_ACCESS_FULLNAME = translate('Public Access');
if ($fullname == 'Public Access') {
$fullname = $PUBLIC_ACCESS_FULLNAME;
}
}
示例13: dba
*/
require_once "include/dba.php";
if (!$install) {
$db = new dba($db_host, $db_user, $db_pass, $db_data, $install);
unset($db_host, $db_user, $db_pass, $db_data);
/**
* Load configs from db. Overwrite configs from .htconfig.php
*/
load_config('config');
load_config('system');
require_once "include/session.php";
load_hooks();
call_hooks('init_1');
$maintenance = get_config('system', 'maintenance');
}
$lang = get_browser_language();
load_translation_table($lang);
/**
*
* Important stuff we always need to do.
*
* The order of these may be important so use caution if you think they're all
* intertwingled with no logical order and decide to sort it out. Some of the
* dependencies have changed, but at least at one time in the recent past - the
* order was critical to everything working properly
*
*/
session_start();
/**
* Language was set earlier, but we can over-ride it in the session.
* We have to do it here because the session was just now opened.
示例14: setLanguage
/**
* setLanguage - Set the current user-language.
*
* @return void
* @access private
*/
private function setLanguage()
{
global $db;
//The database connection
if (!empty($_GET['lang'])) {
$this->lang = $_GET['lang'];
$_SESSION['lang'] = $_GET['lang'];
} elseif (!empty($_SESSION['lang'])) {
$this->lang = $_SESSION['lang'];
} elseif ($this->logged_in) {
$lang = $db->getUserInfo($this->username, 'lang_id');
if (!empty($lang[0])) {
$this->lang = $lang[0];
}
} else {
$allowed_langs = array('de', 'en');
$this->lang = get_browser_language($allowed_langs, DEFAULT_LANGUAGE, null, false);
}
}
示例15: load_user_preferences
function load_user_preferences($guest = '')
{
global $ALLOW_COLOR_CUSTOMIZATION, $browser, $DATE_FORMAT, $DATE_FORMAT_MD, $DATE_FORMAT_MY, $DATE_FORMAT_TASK, $has_boss, $is_assistant, $is_nonuser, $is_nonuser_admin, $lang_file, $LANGUAGE, $login, $prefarray, $user, $views;
$browser = get_web_browser();
$browser_lang = get_browser_language();
$colors = array('BGCOLOR' => 1, 'CELLBG' => 1, 'H2COLOR' => 1, 'HASEVENTSBG' => 1, 'MYEVENTS' => 1, 'OTHERMONTHBG' => 1, 'POPUP_BG' => 1, 'POPUP_FG' => 1, 'TABLEBG' => 1, 'TEXTCOLOR' => 1, 'THBG' => 1, 'THFG' => 1, 'TODAYCELLBG' => 1, 'WEEKENDBG' => 1, 'WEEKNUMBER' => 1);
$lang_found = false;
$prefarray = array();
// Allow __public__ pref to be used if logging in or user not validated.
$tmp_login = empty($guest) ? $login : ($guest == 'guest' ? '__public__' : $guest);
$rows = dbi_get_cached_rows('SELECT cal_setting, cal_value
FROM webcal_user_pref WHERE cal_login = ?', array($tmp_login));
if ($rows) {
for ($i = 0, $cnt = count($rows); $i < $cnt; $i++) {
$row = $rows[$i];
$setting = $row[0];
$value = $row[1];
if ($setting == 'LANGUAGE') {
$lang_found = true;
}
if ($ALLOW_COLOR_CUSTOMIZATION == 'N' && isset($colors[$setting])) {
continue;
}
// $sys_setting = 'sys_' . $setting;
// Save system defaults.
if (!empty($GLOBALS[$setting])) {
$GLOBALS['sys_' . $setting] = $GLOBALS[$setting];
}
$GLOBALS[$setting] = $prefarray[$setting] = $value;
}
}
// Set users timezone.
if (isset($GLOBALS['TIMEZONE'])) {
set_env('TZ', $GLOBALS['TIMEZONE']);
}
// Get views for this user and global views.
// If NUC and not authorized by UAC, disallow global views.
$rows = dbi_get_cached_rows('SELECT cal_view_id, cal_name, cal_view_type,
cal_is_global, cal_owner FROM webcal_view WHERE cal_owner = ? ' . ($is_nonuser && (!access_is_enabled() || access_is_enabled() && !access_can_access_function(ACCESS_VIEW, $guest)) ? '' : ' OR cal_is_global = \'Y\' ') . 'ORDER BY cal_name', array($tmp_login));
if ($rows) {
$views = array();
for ($i = 0, $cnt = count($rows); $i < $cnt; $i++) {
$row = $rows[$i];
$url = 'view_';
if ($row[2] == 'E') {
$url .= 'r.php?';
} elseif ($row[2] == 'S') {
$url .= 't.php?';
} elseif ($row[2] == 'T') {
$url .= 't.php?';
} else {
$url .= strtolower($row[2]) . '.php?';
}
$v = array('cal_view_id' => $row[0], 'cal_name' => $row[1], 'cal_view_type' => $row[2], 'cal_is_global' => $row[3], 'cal_owner' => $row[4], 'url' => $url . 'id=' . $row[0]);
$views[] = $v;
}
}
// If user has not set a language preference and admin has not specified a
// language, then use their browser settings to figure it out
// and save it in the database for future use (email reminders).
$lang = 'none';
if (!$lang_found && strlen($tmp_login) && $tmp_login != '__public__') {
if ($LANGUAGE == 'none') {
$lang = $browser_lang;
}
dbi_execute('INSERT INTO webcal_user_pref ( cal_login, cal_setting,
cal_value ) VALUES ( ?, ?, ? )', array($tmp_login, 'LANGUAGE', $lang));
}
reset_language(!empty($LANGUAGE) && $LANGUAGE != 'none' ? $LANGUAGE : $browser_lang);
if (empty($DATE_FORMAT) || $DATE_FORMAT == 'LANGUAGE_DEFINED') {
$DATE_FORMAT = translate('__month__ __dd__, __yyyy__');
}
if (empty($DATE_FORMAT_MY) || $DATE_FORMAT_MY == 'LANGUAGE_DEFINED') {
$DATE_FORMAT_MY = translate('__month__ __yyyy__');
}
if (empty($DATE_FORMAT_MD) || $DATE_FORMAT_MD == 'LANGUAGE_DEFINED') {
$DATE_FORMAT_MD = translate('__month__ __dd__');
}
if (empty($DATE_FORMAT_TASK) || $DATE_FORMAT_TASK == 'LANGUAGE_DEFINED') {
$DATE_FORMAT_TASK = translate('__mm__/__dd__/__yyyy__');
}
$has_boss = user_has_boss($tmp_login);
$is_assistant = empty($user) ? false : user_is_assistant($tmp_login, $user);
$is_nonuser_admin = $user ? user_is_nonuser_admin($tmp_login, $user) : false;
// if ( $is_nonuser_admin ) load_nonuser_preferences ($user);
}