Файл: moduls/language.php
Строк: 70
<?php
// mod Gemorroj
$dir = dirname(__FILE__);
require_once $dir . '/functions.php';
//print_r($_SESSION);
//print dirname(__FILE__).'/language/'.$_SESSION['langpack'].'.dat';
if (isset($_REQUEST['langpack'])) {
$_SESSION['langpack'] = $_REQUEST['langpack'];
include_once $dir . '/language/' . $_SESSION['langpack'] . '.dat';
$_SESSION['language'] = & $language;
}
//print dirname(__FILE__).'/language/'.$_SESSION['langpack'].'.dat';
if (!isset($_SESSION['language']) || !file_exists($dir . '/language/' . $_SESSION['langpack'] . '.dat')) {
// изыг по умолчанию
$_SESSION['langpack'] = 'russian';
include_once $dir . '/language/' . $_SESSION['langpack'] . '.dat';
$_SESSION['language'] = & $language;
}
//print dirname(__FILE__).'/language/'.$_SESSION['langpack'].'.dat';
function view_languages()
{
echo $_SESSION['language']['language'] . ':<br/><select class="enter" name="langpack">';
foreach (glob($GLOBALS['dir'] . '/language/*.dat') as $v) {
$v = pathinfo($v, PATHINFO_FILENAME);
echo '<option value="' . htmlspecialchars($v) . '" ' . sel($v, $_SESSION['langpack']) . '>' . htmlspecialchars($v, ENT_NOQUOTES) . '</option>';
}
echo '</select>';
}
function language_dir($english = '', $russian = '')
{
echo '<input class="enter" name="new[english]" type="text" size="70" value="' . htmlspecialchars($english) . '"/>(english)<br/><input class="enter" name="new[russian]" type="text" size="70" value="' . htmlspecialchars($russian) . '"/>(russian)<br/>';
}
?>