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:
Jan Dittberner 2007-12-02 21:13:47 +00:00
parent dedae6ffb7
commit 77cc35dfb4
15 changed files with 322 additions and 3 deletions

View file

@ -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() {

View file

@ -56,7 +56,7 @@
<dt><img src="images/groups.png" width="16" height="16" alt="Gruppen" /></dt>
<dd>Die Gruppenberechtigungen dieses Verzeichnisses bearbeiten</dd>
<dt><img src="images/delete.png" width="16" height="16" alt="löschen" /></dt>
<dd>Diese Verzeichnis löschen</dd>
<dd>Dieses Verzeichnis löschen</dd>
<dt><img src="images/newdirectory.png" width="16" height="16" alt="neu" /></dt>
<dd>Neues Verzeichnis anlegen</dd>
</dl>

View file

@ -0,0 +1,36 @@
{*
* Error page template.
*
* @author Jan Dittberner <jan@dittberner.info>
* @version $Id$
* @license GPL
* @package DAVAdmin
*
* Copyright (c) 2007 Jan Dittberner
*
* This file is part of DAVAdmin.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*}
<html>
<head>
<title>DAVAdmin - Ein Fehler ist aufgetreten</title>
</head>
<body>
<h1>DAVAdmin - Ein Fehler ist aufgetreten</h1>
<p>{$errormsg}</p>
</body>
</html>

View file

@ -41,7 +41,7 @@
<tr id="uid{$user.uid}">
<td>{$user.username}</td>
<td>{$user.lastname}, {$user.firstname}</td>
<td><a id="edit{$user.uid}" class="editlink" href="#" title="Die Daten dieses Nutzers bearbeiten"><img class="actionicon" src="images/edit.png" width="16" height="16" alt="bearbeiten"/></a>{if !$user.loggedin}<a id="delete{$user.uid}" class="deletelink" href="#" title="Die Daten dieses Nutzers löschen"><img class="actionicon" src="images/delete.png" width="16" height="16" alt="löschen" /></a>{/if}</td>
<td><a id="edit{$user.uid}" class="editlink" href="#" title="Die Daten dieses Nutzers bearbeiten"><img class="actionicon" src="images/edit.png" width="16" height="16" alt="bearbeiten"/></a>{if !$user.loggedin}<a id="delete{$user.uid}" class="deletelink" href="#" title="Die Daten dieses Nutzers löschen."><img class="actionicon" src="images/delete.png" width="16" height="16" alt="löschen" /></a>{/if}</td>
</tr>
{/foreach}
</tbody>

View file

@ -0,0 +1,66 @@
{*
* Directory page template.
*
* @author Jan Dittberner <jan@dittberner.info>
* @version $Id$
* @license GPL
* @package DAVAdmin
*
* Copyright (c) 2007 Jan Dittberner
*
* This file is part of DAVAdmin.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*}
{include file="header.html" title="Directory management"}
<script type="text/javascript" src="scripts/helper.js"></script>
<script type="text/javascript" src="scripts/autocomplete.js"></script>
<script type="text/javascript" src="scripts/directories.js"></script><div id="content">
<h1>WebDAV administration</h1>
<h2>Directory management</h2>
<table id="dirtable">
<thead>
<tr><th id="hcol-directory">Directory</th><th id="hcol-groups">Groups</th><th id="hcol-files">included files (count and size)</th><th /></tr>
</thead>
<tbody>
{foreach item=dir from=$directories}
<tr id="dir{$dir.name}">
<td>{$dir.name}</td>
<td>{foreach item=group from=$dir.groups name=dirloop}{$group}{if !$smarty.foreach.dirloop.last}, {/if}{/foreach}</td>
<td>{$dir.filecount}, {$dir.filesize}</td>
<td><a id="edit{$dir.name}" class="editlink" href="#" title="Edit this directory's group assignments."><img class="actionicon" src="images/groups.png" width="16" height="16" alt="Groups"/></a>{if $dir.maydelete}<a id="delete{$dir.name}" class="deletelink" href="#" title="Delete this directory"><img class="actionicon" src="images/delete.png" width="16" height="16" alt="delete" /></a>{/if}</td>
</tr>
{foreachelse}
<tr><td colspan="4">there are no directories</td></tr>
{/foreach}
</tbody>
<tfoot>
<tr><td colspan="4"><a id="newdir" class="newlink" href="#" title="Create new directory"><img class="actionicon" src="images/newdirectory.png" width="16" height="16" alt="new" /></a></td></tr>
</tfoot>
</table>
<h3>Icon description</h3>
<dl>
<dt><img src="images/groups.png" width="16" height="16" alt="groups" /></dt>
<dd>Edit this directory's group assignments.</dd>
<dt><img src="images/delete.png" width="16" height="16" alt="delete" /></dt>
<dd>Delete this directory</dd>
<dt><img src="images/newdirectory.png" width="16" height="16" alt="new" /></dt>
<dd>Create new directory</dd>
</dl>
<div id="footer"><a href="index.php">Back</a></div>
</div>
<div id="direditor"></div>
{include file="footer.html"}

View file

@ -0,0 +1,28 @@
{*
* Error XML template.
*
* @author Jan Dittberner <jan@dittberner.info>
* @version $Id$
* @license GPL
* @package DAVAdmin
*
* Copyright (c) 2007 Jan Dittberner
*
* This file is part of DAVAdmin.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*}
<?xml version="1.0" encoding="UTF-8"?><error><errormsg>{$errormsg}</errormsg></error>

View file

@ -0,0 +1,28 @@
{*
* Page footer template.
*
* @author Jan Dittberner <jan@dittberner.info>
* @version $Id$
* @license GPL
* @package DAVAdmin
*
* Copyright (c) 2007 Jan Dittberner
*
* This file is part of DAVAdmin.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*}
</body></html>

View file

@ -0,0 +1,37 @@
{*
* Page header template.
*
* @author Jan Dittberner <jan@dittberner.info>
* @version $Id$
* @license GPL
* @package DAVAdmin
*
* Copyright (c) 2007 Jan Dittberner
*
* This file is part of DAVAdmin.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de">
<head><title>{$smarty.server.SERVER_NAME} - WebDAV administration{if $title} - {$title}{/if}</title></head>
<link rel="stylesheet" type="text/css" href="format.css" />
<link rel="stylesheet" type="text/css" href="dynaform.css" />
<script type="text/javascript" src="scripts/jquery.js"></script>
<script type="text/javascript" src="scripts/translate.js"></script>
<script type="text/javascript" src="scripts/i18n.php" ></script>
<body>

View file

@ -0,0 +1,35 @@
{*
* Start page template.
*
* @author Jan Dittberner <jan@dittberner.info>
* @version $Id$
* @license GPL
* @package DAVAdmin
*
* Copyright (c) 2007 Jan Dittberner
*
* This file is part of DAVAdmin.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*}
{include file="header.html"}
<h1>WebDAV Administration</h1>
<p>Welcome to the WebDAV administration at {$smarty.server.SERVER_NAME}. You have the following options.</p>
<ul>
<li><a href="directories.php">Directory management</a></li>
<li><a href="users.php">User management</a></li>
</ul>
{include file="footer.html"}

View file

@ -0,0 +1,64 @@
{*
* User page template.
*
* @author Jan Dittberner <jan@dittberner.info>
* @version $Id$
* @license GPL
* @package DAVAdmin
*
* Copyright (c) 2007 Jan Dittberner
*
* This file is part of DAVAdmin.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*}
{include file="header.html" title="User management"}
<script type="text/javascript" src="scripts/helper.js"></script>
<script type="text/javascript" src="scripts/autocomplete.js"></script>
<script type="text/javascript" src="scripts/users.js"></script>
<div id="content">
<h1>WebDAV administration</h1>
<h2>User management</h2>
<table id="usertable">
<thead>
<tr><th id="hcol-username">User name</th><th id="hcol-name">First name, last name</th><th /></tr>
</thead>
<tbody>
{foreach item=user from=$users}
<tr id="uid{$user.uid}">
<td>{$user.username}</td>
<td>{$user.lastname}, {$user.firstname}</td>
<td><a id="edit{$user.uid}" class="editlink" href="#" title="Edit this user's data."><img class="actionicon" src="images/edit.png" width="16" height="16" alt="edit"/></a>{if !$user.loggedin}<a id="delete{$user.uid}" class="deletelink" href="#" title="Delete this user's data."><img class="actionicon" src="images/delete.png" width="16" height="16" alt="delete" /></a>{/if}</td>
</tr>
{/foreach}
</tbody>
<tfoot>
<tr><td colspan="3"><a id="newuser" class="newlink" href="#" title="Create new user"><img class="actionicon" src="images/newuser.png" width="16" height="16" alt="new" /></a></td></tr>
</tfoot>
</table>
<h3>Icon description</h3>
<dl>
<dt><img src="images/edit.png" width="16" height="16" alt="edit" /></dt>
<dd>Edit this user's data.</dd>
<dt><img src="images/delete.png" width="16" height="16" alt="delete" /></dt>
<dd>Delete this user's data.</dd>
<dt><img src="images/newuser.png" width="16" height="16" alt="new" /></dt>
<dd>Create new user</dd>
</dl>
<div id="footer"><a href="index.php">Back</a></div>
</div>
<div id="usereditor"></div>
{include file="footer.html"}