fixes #9
addresses #18 addresses #17 * create an english translation of the templates * change the template directory for smarty depending on the language * move existing templates to german subdirectory
This commit is contained in:
parent
dedae6ffb7
commit
77cc35dfb4
15 changed files with 322 additions and 3 deletions
|
@ -38,7 +38,32 @@ require_once("smarty/libs/Smarty.class.php");
|
|||
|
||||
/** Global Smarty template engine instance. */
|
||||
$smarty = new Smarty();
|
||||
$smarty->compile_dir = $davconfig['compile_dir'];
|
||||
|
||||
// negotiate the correct template_dir
|
||||
if (is_dir(($dir = realpath(implode(DIRECTORY_SEPARATOR,
|
||||
array($smarty->template_dir,
|
||||
$_SESSION["language"])))))) {
|
||||
$smarty->template_dir = $dir;
|
||||
} else if (is_dir(($dir = realpath(implode(DIRECTORY_SEPARATOR,
|
||||
array($smarty->template_dir,
|
||||
substr($_SESSION["language"],
|
||||
0, 2))))))) {
|
||||
$smarty->template_dir = $dir;
|
||||
} else {
|
||||
_server_error(sprintf(_("Could not find one of the language directories!\n%s,\n%s"),
|
||||
implode(DIRECTORY_SEPARATOR,
|
||||
array($smarty->template_dir,
|
||||
$_SESSION["language"])),
|
||||
implode(DIRECTORY_SEPARATOR,
|
||||
array($smarty->template_dir,
|
||||
substr($_SESSION["language"], 0, 2)))));
|
||||
}
|
||||
$compile_dir = implode(DIRECTORY_SEPARATOR, array($davconfig['compile_dir'],
|
||||
$_SESSION["language"]));
|
||||
if (!is_dir($compile_dir)) {
|
||||
mkdir($compile_dir);
|
||||
}
|
||||
$smarty->compile_dir = $compile_dir;
|
||||
|
||||
/** Handle invalid requests to the application. */
|
||||
function invalidCall() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue