本文整理汇总了PHP中TTi18n::setLocaleCookie方法的典型用法代码示例。如果您正苦于以下问题:PHP TTi18n::setLocaleCookie方法的具体用法?PHP TTi18n::setLocaleCookie怎么用?PHP TTi18n::setLocaleCookie使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TTi18n
的用法示例。
在下文中一共展示了TTi18n::setLocaleCookie方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: switch
$action = Misc::findSubmitButton();
switch ($action) {
case 'submit':
//Debug::setVerbosity( 11 );
Debug::Text('User Name: ' . $user_name, __FILE__, __LINE__, __METHOD__, 10);
if (isset($config_vars['other']['web_session_expire']) and $config_vars['other']['web_session_expire'] != '') {
$authentication->setEnableExpireSession((int) $config_vars['other']['web_session_expire']);
}
$authentication_result = $authentication->Login($user_name, $password);
if ($authentication_result === TRUE) {
$authentication->Check();
Debug::text('Login Language: ' . $language, __FILE__, __LINE__, __METHOD__, 10);
TTi18n::setCountry(TTi18n::getCountryFromLocale());
TTi18n::setLanguage($language);
TTi18n::setLocale();
TTi18n::setLocaleCookie();
Debug::text('Locale: ' . TTi18n::getLocale(), __FILE__, __LINE__, __METHOD__, 10);
$clf = TTnew('CompanyListFactory');
$clf->getByID($authentication->getObject()->getCompany());
$current_company = $clf->getCurrent();
unset($clf);
$create_new_station = FALSE;
//If this is a new station, insert it now.
if (isset($_COOKIE['StationID'])) {
Debug::text('Station ID Cookie found! ' . $_COOKIE['StationID'], __FILE__, __LINE__, __METHOD__, 10);
$slf = TTnew('StationListFactory');
$slf->getByStationIdandCompanyId($_COOKIE['StationID'], $current_company->getId());
$current_station = $slf->getCurrent();
unset($slf);
if ($current_station->isNew()) {
Debug::text('Station ID is NOT IN DB!! ' . $_COOKIE['StationID'], __FILE__, __LINE__, __METHOD__, 10);
示例2: unset
$upf->setEnableEmailNotificationException(FALSE);
}
if (isset($pref_data['enable_email_notification_message'])) {
$upf->setEnableEmailNotificationMessage(TRUE);
} else {
$upf->setEnableEmailNotificationMessage(FALSE);
}
if (isset($pref_data['enable_email_notification_home'])) {
$upf->setEnableEmailNotificationHome(TRUE);
} else {
$upf->setEnableEmailNotificationHome(FALSE);
}
if ($upf->isValid()) {
$upf->Save(FALSE);
if ($current_user->getId() == $upf->getUser()) {
TTi18n::setLocaleCookie($pref_data['language'] . '_' . $current_user->getCountry());
}
Redirect::Page(URLBuilder::getURL(array('user_id' => $pref_data['user_id'], 'data_saved' => 1), Environment::getBaseURL() . '/users/EditUserPreference.php'));
unset($upf);
break;
}
default:
if (!isset($user_id) or isset($user_id) and $user_id == '') {
$user_id = $current_user->getId();
}
$ulf->getByIdAndCompanyId($user_id, $current_company->getId());
if ($ulf->getRecordCount() > 0) {
$user_obj = $ulf->getCurrent();
}
if (!isset($action)) {
BreadCrumb::setCrumb($title);