Файл: modules/setlang/index.php
Строк: 31
<?php
switch ($act)
{
default:
if ($refurl && $refurl != HTTPHOME.'setlang/')
{
$_SESSION['lang_refurl'] = $refurl;
}
$lng = isset($_POST['lng']) ? check($_POST['lng']) : FALSE;
if ($lng)
{
$language = DB::run()->queryFetch("select `file` from `language` where `file` = ?;", array($lng));
if ($language)
{
$lng = $language['file'];
}
else
{
$lng = $config['language'];
}
setcookie("lng", $lng, time() + 3600 * 24 * 365, '/', '');
$redirect = isset($_SESSION['lang_refurl']) ? $_SESSION['lang_refurl'] : HTTPHOME;
unset($_SESSION['lang_refurl']);
redirect($redirect);
}
$query = DB::run()->query("select * from `language`;");
$config['newtitle'] = $lang['Language'];
$tpl['file'] = 'setlang';
require_once 'core/header.php';
break;
}