added the webui to the tarball

This commit is contained in:
SJ
2012-02-08 23:14:28 +01:00
parent 79cdeed1b6
commit 1211e9a39c
272 changed files with 26456 additions and 11 deletions

40
webui/system/language.php Normal file
View File

@ -0,0 +1,40 @@
<?php
class Language {
public $data = array();
public function __construct () {
if(isset($_SESSION['lang'])) {
$file = DIR_LANGUAGE . $_SESSION['lang'] . '/messages.php';
} else {
$file = DIR_LANGUAGE . LANG . '/messages.php';
}
if (file_exists($file)) {
$_ = array();
require($file);
$this->data = array_merge($this->data, $_);
}
else {
exit('Error: Could not load language ' . $file . '!');
}
}
public function get($key) {
return (isset($this->data[$key]) ? $this->data[$key] : $key);
}
}
?>