".LAN_CHECK_7." |
{$LANGUAGES_DIRECTORY} English/{$filename} |
{$LANGUAGES_DIRECTORY} {$language}/{$filename} |
";
foreach($keys as $k) {
$ret .= "
";
if (isset($check[$filename][$k])) {
$ret .= "";
} else {
$ret .= "";
}
$ret .= "
";
}
$ret .= "";
return $ret;
}
function get_lan_phrases($lang)
{
$ret = array();
// Read English lan_ files
$base_dir = e_LANGUAGEDIR.$lang;
if ($r = opendir($base_dir))
{
while ($file = readdir($r))
{
$fname = $base_dir."/".$file;
if (strpos($file, "lan_") === 0 && is_file($fname))
{
$data = file($fname);
foreach($data as $line)
{
if (preg_match("#\"(.*?)\".*?\"(.*)\"#", $line, $matches)) {
$ret[$file][$matches[1]] = htmlentities($matches[2]);
}
}
}
}
closedir($r);
}
// Read $lang/admin lan_ files
$base_dir = e_LANGUAGEDIR.$lang."/admin";
if ($r = opendir($base_dir))
{
while ($file = readdir($r))
{
$fname = $base_dir."/".$file;
if (strpos($file, "lan_") === 0 && is_file($fname))
{
$data = file($fname);
foreach($data as $line)
{
if (preg_match("#\"(.*?)\".*?\"(.*)\"#", $line, $matches))
{
$ret["admin/".$file][$matches[1]] = $matches[2];
}
}
}
}
closedir($r);
}
return $ret;
}
function check_core_lanfiles($checklan) {
$English = get_lan_phrases("English");
$check = get_lan_phrases($checklan);
$text .= "";
$keys = array_keys($English);
sort($keys);
foreach($keys as $k) {
$lnk = "{$k}";
if (array_key_exists($k, $check)) {
$text .= "";
$subkeys = array_keys($English[$k]);
sort($subkeys);
$er = "";
foreach($subkeys as $sk) {
if (!array_key_exists($sk, $check[$k])) {
$er .= ($er) ? "
" :
"";
$er .= $sk." ".LAN_CHECK_5;
}
}
if ($er) {
$text .= "
";
} else {
$text .= "";
}
} else {
$text .= "
";
}
}
$text .= "
";
return $text;
}
function show_languages()
{
if ($r = opendir(e_LANGUAGEDIR))
{
while ($file = readdir($r))
{
$fname = e_LANGUAGEDIR.$file;
if (is_dir($fname) && $file != "English" && $file != "CVS" && $file != "." && $file != "..")
{
$languages[] = $file;
}
}
$text .= "
";
return $text;
}
}
function find_plugins($path)
{
static $plugin_list;
if($path == "")
{
$path = e_PLUGIN;
}
if(substr($path,-1) == '/') {
$path = substr($path, 0, -1);
}
if($handle = opendir($path))
{
while (false !== ($file = readdir($handle)))
{
if($file == "English.php")
{
$plugin_list['file'][] = $path;
}
if(is_dir($path."/".$file) && $file !== "." && $file !== ".." && $file !== "CVS")
{
if($file == "English")
{
$plugin_list['dir'][] = $path;
}
else
{
$xx = find_plugins($path."/".$file);
}
}
}
return $plugin_list;
}
return FALSE;
}
if (e_QUERY)
{
$qs = explode(".", rawurldecode(e_QUERY), 2);
$text = show_comparison($qs[0], $qs[1]);
$ns->tablerender(LAN_CHECK_3.": {$qs[0]}", $text);
require_once("footer.php");
exit;
}
if ($_POST['check_lang'])
{
$text = check_core_lanfiles($_POST['language']);
$ns->tablerender(LAN_CHECK_3.": ".$_POST['language'], $text);
require_once("footer.php");
exit;
}
$ns->tablerender("", show_languages());
require_once("footer.php");
?>