aboutsummaryrefslogtreecommitdiff
path: root/ratatoeskr
diff options
context:
space:
mode:
Diffstat (limited to 'ratatoeskr')
-rw-r--r--ratatoeskr/backend/main.php65
-rw-r--r--ratatoeskr/cms_style/images/black_transparent.pngbin0 -> 178 bytes
-rw-r--r--ratatoeskr/cms_style/images/login_bg.jpgbin0 -> 66962 bytes
-rw-r--r--ratatoeskr/cms_style/login.css119
-rw-r--r--ratatoeskr/libs/.gitignore2
-rw-r--r--ratatoeskr/libs/INFO7
-rw-r--r--ratatoeskr/licenses/smarty165
-rw-r--r--ratatoeskr/licenses/stupid_template_engine17
-rw-r--r--ratatoeskr/main.php15
-rw-r--r--ratatoeskr/sys/init_ste.php46
-rw-r--r--ratatoeskr/sys/load_smarty.php30
-rw-r--r--ratatoeskr/sys/models.php4
-rw-r--r--ratatoeskr/sys/plugin_api.php12
-rw-r--r--ratatoeskr/sys/translation.php55
-rwxr-xr-x[-rw-r--r--]ratatoeskr/templates/.htaccess0
-rwxr-xr-xratatoeskr/templates/src/systemtemplates/backend_login.html34
-rw-r--r--ratatoeskr/templates/systemtemplates/backend_login.html13
-rw-r--r--ratatoeskr/templates/usertemplates/foo.tpl14
-rw-r--r--ratatoeskr/tmp/smarty/.gitignore2
-rw-r--r--ratatoeskr/tmp/smarty/INFO6
-rw-r--r--ratatoeskr/translations/en.php7
21 files changed, 360 insertions, 253 deletions
diff --git a/ratatoeskr/backend/main.php b/ratatoeskr/backend/main.php
index e0adbdc..cd7bb35 100644
--- a/ratatoeskr/backend/main.php
+++ b/ratatoeskr/backend/main.php
@@ -9,17 +9,74 @@
* See "ratatoeskr/licenses/ratatoeskr" for more information.
*/
-require_once(dirname(__FILE__) . "/../sys/");
-
-
+require_once(dirname(__FILE__) . "/../sys/models.php");
+require_once(dirname(__FILE__) . "/../sys/pwhash.php");
$backend_subactions = url_action_subactions(array(
"_default" => url_action_alias(array("login")),
+ "_prelude" => function(&$data, $url_now, &$url_next)
+ {
+ global $ratatoeskr_settings;
+ /* Check authentification */
+ if(isset($_SESSION["uid"]))
+ {
+ try
+ {
+ $user = User::by_id($_SESSION["uid"]);
+ if($user->pwhash == $_SESSION["pwhash"])
+ {
+ if(empty($user->language))
+ {
+ $user->language = $ratatoeskr_settings["default_language"];
+ $user->save();
+ }
+ load_language($user->language);
+
+ if($url_next[0] == "login")
+ $url_next = array("content", "write");
+ return; /* Authentification successful, continue */
+ }
+ else
+ unset($_SESSION["uid"]);
+ }
+ catch(DoesNotExistError $e)
+ {
+ unset($_SESSION["uid"]);
+ }
+ }
+ load_language();
+ /* If we are here, user is not logged in... */
+ $url_next = array("login");
+ },
+ "index" => url_action_alias(array("login")),
"login" => url_action_simple(function($data)
{
+ global $ste;
+ if(!empty($_POST["user"]))
+ {
+ try
+ {
+ $user = User::by_name($_POST["user"]);
+ if(!PasswordHash::validate($_POST["password"], $user->pwhash))
+ throw new Exception();
+ $_SESSION["uid"] = $user->get_id();
+ $_SESSION["pwhash"] = $user->pwhash;
+ }
+ catch(Exception $e)
+ {
+ $ste->vars["login_failed"] = True;
+ }
+
+ /* Login successful. Now redirect... */
+ throw new Redirect(array("content", "write"));
+ }
+ echo $ste->exectemplate("systemtemplates/backend_login.html");
}),
-
+ "content" => url_action_simple(function($data)
+ {
+ print "hi";
+ })
));
?>
diff --git a/ratatoeskr/cms_style/images/black_transparent.png b/ratatoeskr/cms_style/images/black_transparent.png
new file mode 100644
index 0000000..bfe2e3a
--- /dev/null
+++ b/ratatoeskr/cms_style/images/black_transparent.png
Binary files differ
diff --git a/ratatoeskr/cms_style/images/login_bg.jpg b/ratatoeskr/cms_style/images/login_bg.jpg
new file mode 100644
index 0000000..e24fd8f
--- /dev/null
+++ b/ratatoeskr/cms_style/images/login_bg.jpg
Binary files differ
diff --git a/ratatoeskr/cms_style/login.css b/ratatoeskr/cms_style/login.css
new file mode 100644
index 0000000..3e756ca
--- /dev/null
+++ b/ratatoeskr/cms_style/login.css
@@ -0,0 +1,119 @@
+* {
+ font-family: sans-serif;
+ font-size: 10pt;
+}
+
+body, html {
+ margin: 0px;
+ padding:0px;
+}
+
+#main {
+ margin: 0px;
+ padding: 0px;
+ width: 100%;
+ height: 100%;
+ z-index: 1;
+ position: absolute;
+}
+
+#background_image {
+ position: absolute;
+ left: 0px;
+ top:0px;
+ z-index: 0;
+ width: 100%;
+ height: 100%;
+ margin: 0px;
+ padding: 0px;
+}
+
+#bar_top {
+ margin: 0px;
+ position: fixed;
+ top: 0px;
+ left: 0px;
+ width: 100%;
+ background: black;
+ padding: 3px 15px 3px;
+ color: #ddd;
+}
+
+#bar_top strong {
+ color: white;
+}
+
+#image_copyright {
+ margin: 0px;
+ position: fixed;
+ bottom: 0px;
+ left: 0px;
+ width: 100%;
+ background: black;
+ padding: 3px 15px 3px;
+ color: #ddd;
+}
+
+#image_copyright a {
+ color: #ddd;
+ text-decoration: underline;
+}
+
+#image_copyright a:hover {
+ color: white;
+}
+
+.vcenter_outer {
+ position: absolute;
+ height: 100%;
+ display: table;
+ width: 100%;
+}
+
+.vcenter_inner {
+ display: table-cell;
+ vertical-align: middle;
+ text-align: center;
+ width: 100%;
+}
+
+#login_box {
+ position: relative;
+ padding: 15px 20px 15px;
+ margin-left: 25%;
+ width: 50%;
+ background: url(images/black_transparent.png) repeat;
+}
+
+h1 {
+ font-size: 14pt;
+ color: white;
+}
+
+#login_box p {
+ color: white;
+ text-align: left;
+ clear: both;
+}
+
+#login_box p input {
+ float: right;
+}
+
+#login_box p.loginbtn {
+ text-align: center;
+}
+
+#login_box p.loginbtn input {
+ float: none;
+}
+
+div.error {
+ position: relative;
+ width: 100%;
+ padding: 10px 0px 10px;
+ margin: none;
+ color: red;
+ text-align: center;
+ background: #fbb;
+}
diff --git a/ratatoeskr/libs/.gitignore b/ratatoeskr/libs/.gitignore
index 1af7787..71dd7fe 100644
--- a/ratatoeskr/libs/.gitignore
+++ b/ratatoeskr/libs/.gitignore
@@ -1,2 +1,2 @@
-smarty
+stupid_template_engine.php
markdown.php
diff --git a/ratatoeskr/libs/INFO b/ratatoeskr/libs/INFO
index 5298ab2..e5c9364 100644
--- a/ratatoeskr/libs/INFO
+++ b/ratatoeskr/libs/INFO
@@ -1,11 +1,10 @@
This directory will hold some libraries Ratatöskr needs.
-1. Smarty Template engine
+1. Stupid Template Engine (STE)
- Create a directory called "smarty" and place the content of the "libs"
- directory there.
+ Place "stupid_template_engine.php" directly into this directory.
- Smarty can be found here: <http://www.smarty.net/download>
+ STE can be found here: <https://github.com/kch42/Stupid-Template-Engine>
2. PHP Markdown
diff --git a/ratatoeskr/licenses/smarty b/ratatoeskr/licenses/smarty
deleted file mode 100644
index 02bbb60..0000000
--- a/ratatoeskr/licenses/smarty
+++ /dev/null
@@ -1,165 +0,0 @@
- GNU LESSER GENERAL PUBLIC LICENSE
- Version 3, 29 June 2007
-
- Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-
- This version of the GNU Lesser General Public License incorporates
-the terms and conditions of version 3 of the GNU General Public
-License, supplemented by the additional permissions listed below.
-
- 0. Additional Definitions.
-
- As used herein, "this License" refers to version 3 of the GNU Lesser
-General Public License, and the "GNU GPL" refers to version 3 of the GNU
-General Public License.
-
- "The Library" refers to a covered work governed by this License,
-other than an Application or a Combined Work as defined below.
-
- An "Application" is any work that makes use of an interface provided
-by the Library, but which is not otherwise based on the Library.
-Defining a subclass of a class defined by the Library is deemed a mode
-of using an interface provided by the Library.
-
- A "Combined Work" is a work produced by combining or linking an
-Application with the Library. The particular version of the Library
-with which the Combined Work was made is also called the "Linked
-Version".
-
- The "Minimal Corresponding Source" for a Combined Work means the
-Corresponding Source for the Combined Work, excluding any source code
-for portions of the Combined Work that, considered in isolation, are
-based on the Application, and not on the Linked Version.
-
- The "Corresponding Application Code" for a Combined Work means the
-object code and/or source code for the Application, including any data
-and utility programs needed for reproducing the Combined Work from the
-Application, but excluding the System Libraries of the Combined Work.
-
- 1. Exception to Section 3 of the GNU GPL.
-
- You may convey a covered work under sections 3 and 4 of this License
-without being bound by section 3 of the GNU GPL.
-
- 2. Conveying Modified Versions.
-
- If you modify a copy of the Library, and, in your modifications, a
-facility refers to a function or data to be supplied by an Application
-that uses the facility (other than as an argument passed when the
-facility is invoked), then you may convey a copy of the modified
-version:
-
- a) under this License, provided that you make a good faith effort to
- ensure that, in the event an Application does not supply the
- function or data, the facility still operates, and performs
- whatever part of its purpose remains meaningful, or
-
- b) under the GNU GPL, with none of the additional permissions of
- this License applicable to that copy.
-
- 3. Object Code Incorporating Material from Library Header Files.
-
- The object code form of an Application may incorporate material from
-a header file that is part of the Library. You may convey such object
-code under terms of your choice, provided that, if the incorporated
-material is not limited to numerical parameters, data structure
-layouts and accessors, or small macros, inline functions and templates
-(ten or fewer lines in length), you do both of the following:
-
- a) Give prominent notice with each copy of the object code that the
- Library is used in it and that the Library and its use are
- covered by this License.
-
- b) Accompany the object code with a copy of the GNU GPL and this license
- document.
-
- 4. Combined Works.
-
- You may convey a Combined Work under terms of your choice that,
-taken together, effectively do not restrict modification of the
-portions of the Library contained in the Combined Work and reverse
-engineering for debugging such modifications, if you also do each of
-the following:
-
- a) Give prominent notice with each copy of the Combined Work that
- the Library is used in it and that the Library and its use are
- covered by this License.
-
- b) Accompany the Combined Work with a copy of the GNU GPL and this license
- document.
-
- c) For a Combined Work that displays copyright notices during
- execution, include the copyright notice for the Library among
- these notices, as well as a reference directing the user to the
- copies of the GNU GPL and this license document.
-
- d) Do one of the following:
-
- 0) Convey the Minimal Corresponding Source under the terms of this
- License, and the Corresponding Application Code in a form
- suitable for, and under terms that permit, the user to
- recombine or relink the Application with a modified version of
- the Linked Version to produce a modified Combined Work, in the
- manner specified by section 6 of the GNU GPL for conveying
- Corresponding Source.
-
- 1) Use a suitable shared library mechanism for linking with the
- Library. A suitable mechanism is one that (a) uses at run time
- a copy of the Library already present on the user's computer
- system, and (b) will operate properly with a modified version
- of the Library that is interface-compatible with the Linked
- Version.
-
- e) Provide Installation Information, but only if you would otherwise
- be required to provide such information under section 6 of the
- GNU GPL, and only to the extent that such information is
- necessary to install and execute a modified version of the
- Combined Work produced by recombining or relinking the
- Application with a modified version of the Linked Version. (If
- you use option 4d0, the Installation Information must accompany
- the Minimal Corresponding Source and Corresponding Application
- Code. If you use option 4d1, you must provide the Installation
- Information in the manner specified by section 6 of the GNU GPL
- for conveying Corresponding Source.)
-
- 5. Combined Libraries.
-
- You may place library facilities that are a work based on the
-Library side by side in a single library together with other library
-facilities that are not Applications and are not covered by this
-License, and convey such a combined library under terms of your
-choice, if you do both of the following:
-
- a) Accompany the combined library with a copy of the same work based
- on the Library, uncombined with any other library facilities,
- conveyed under the terms of this License.
-
- b) Give prominent notice with the combined library that part of it
- is a work based on the Library, and explaining where to find the
- accompanying uncombined form of the same work.
-
- 6. Revised Versions of the GNU Lesser General Public License.
-
- The Free Software Foundation may publish revised and/or new versions
-of the GNU Lesser General Public License from time to time. Such new
-versions will be similar in spirit to the present version, but may
-differ in detail to address new problems or concerns.
-
- Each version is given a distinguishing version number. If the
-Library as you received it specifies that a certain numbered version
-of the GNU Lesser General Public License "or any later version"
-applies to it, you have the option of following the terms and
-conditions either of that published version or of any later version
-published by the Free Software Foundation. If the Library as you
-received it does not specify a version number of the GNU Lesser
-General Public License, you may choose any version of the GNU Lesser
-General Public License ever published by the Free Software Foundation.
-
- If the Library as you received it specifies that a proxy can decide
-whether future versions of the GNU Lesser General Public License shall
-apply, that proxy's public statement of acceptance of any version is
-permanent authorization for you to choose that version for the
-Library. \ No newline at end of file
diff --git a/ratatoeskr/licenses/stupid_template_engine b/ratatoeskr/licenses/stupid_template_engine
new file mode 100644
index 0000000..b220583
--- /dev/null
+++ b/ratatoeskr/licenses/stupid_template_engine
@@ -0,0 +1,17 @@
+Copyright (c) 2011 Kevin Chabowski
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS
+IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
+TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
+THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/ratatoeskr/main.php b/ratatoeskr/main.php
index 70a54cc..09f4d8d 100644
--- a/ratatoeskr/main.php
+++ b/ratatoeskr/main.php
@@ -12,14 +12,15 @@
require_once(dirname(__FILE__) . "/sys/db.php");
require_once(dirname(__FILE__) . "/sys/plugin_api.php");
require_once(dirname(__FILE__) . "/sys/models.php");
-require_once(dirname(__FILE__) . "/sys/load_smarty.php");
+require_once(dirname(__FILE__) . "/sys/init_ste.php");
+require_once(dirname(__FILE__) . "/sys/translation.php");
require_once(dirname(__FILE__) . "/sys/urlprocess.php");
-require_once(dirname(__FILE__) . "/frontend.php");
+#require_once(dirname(__FILE__) . "/frontend.php");
require_once(dirname(__FILE__) . "/backend/main.php");
function ratatoeskr()
{
- global $backend_subactions, $smarty;
+ global $backend_subactions, $ste, $url_handlers;
session_start();
if(!CONFIG_FILLED_OUT)
return setup();
@@ -37,14 +38,16 @@ function ratatoeskr()
}
/* Register URL handlers */
- register_url_handler("_default", "frontend_url_handler");
+ #register_url_handler("_default", "frontend_url_handler");
register_url_handler("backend", $backend_subactions);
- register_url_handler("_notfound", "e404handler");
+ #register_url_handler("_notfound", "e404handler");
$urlpath = explode("/", $_GET["action"]);
$rel_path_to_root = implode("/", array_merge(array("."), array_repeat("..", count($urlpath) - 1)));
$data = array("rel_path_to_root" => $rel_path_to_root);
- $smarty->assign("rel_path_to_root", $rel_path_to_root);
+ $ste->vars["rel_path_to_root"] = $rel_path_to_root;
+
+ url_process($urlpath, $url_handlers, $data);
}
?>
diff --git a/ratatoeskr/sys/init_ste.php b/ratatoeskr/sys/init_ste.php
new file mode 100644
index 0000000..567a32b
--- /dev/null
+++ b/ratatoeskr/sys/init_ste.php
@@ -0,0 +1,46 @@
+<?php
+
+/*
+ * File: ratatoeskr/sys/init_ste.php
+ *
+ * When included, the file will initialize the global STECore instance.
+ *
+ * License:
+ * This file is part of Ratatöskr.
+ * Ratatöskr is licensed unter the MIT / X11 License.
+ * See "ratatoeskr/licenses/ratatoeskr" for more information.
+ */
+
+require_once(dirname(__FILE__) . "/../libs/stupid_template_engine.php");
+
+$tpl_basedir = dirname(__FILE__) . "/../templates";
+
+if(!isset($ste))
+{
+ /*
+ * Variable: $ste
+ *
+ * The global STECore (Stupid Template Engine) instance.
+ */
+ $ste = new \ste\STECore(new \ste\FilesystemStorageAccess("$tpl_basedir/src", "$tpl_basedir/transc"));
+}
+
+$ste->register_tag(
+ "l10n_replace",
+ function($ste, $params, $sub)
+ {
+ $content = $sub($ste);
+ foreach($params as $name => $replace)
+ $content = str_replace("[[$name]]", $replace, $content);
+ return $content;
+ }
+);
+$ste->register_tag(
+ "capitalize",
+ function($ste, $params, $sub)
+ {
+ return ucwords($sub($ste));
+ }
+);
+
+?>
diff --git a/ratatoeskr/sys/load_smarty.php b/ratatoeskr/sys/load_smarty.php
deleted file mode 100644
index 43df957..0000000
--- a/ratatoeskr/sys/load_smarty.php
+++ /dev/null
@@ -1,30 +0,0 @@
-<?php
-/*
- * File: ratatoeskr/sys/load_smarty.php
- *
- * Create the global Smarty instance.
- *
- * License:
- * This file is part of Ratatöskr.
- * Ratatöskr is licensed unter the MIT / X11 License.
- * See "ratatoeskr/licenses/ratatoeskr" for more information.
- */
-
-require_once(dirname(__FILE__) . "/../libs/smarty/Smarty.class.php");
-
-if(!isset($smarty))
-{
- /*
- * Variable: $smarty
- * Global smarty instance.
- */
- $smarty = new Smarty();
- $smarty->setTemplateDir(dirname(__FILE__) . "/../templates/");
- $smarty->setCompileDir(dirname(__FILE__) . "/../tmp/smartytemplates_c");
- $smarty->setCacheDir(dirname(__FILE__) . "/../tmp/smarty/cache");
- $smarty->setConfigDir(dirname(__FILE__) . "/../smarty_confdir");
- $smarty->left_delimiter = "{%";
- $smarty->right_delimiter = "%}";
-}
-
-?>
diff --git a/ratatoeskr/sys/models.php b/ratatoeskr/sys/models.php
index d8da3b0..21147fb 100644
--- a/ratatoeskr/sys/models.php
+++ b/ratatoeskr/sys/models.php
@@ -31,7 +31,7 @@ $imagetype_file_extensions = array(
* Variable: $ratatoeskr_settings
* The global <Settings> object. For internal use.
*/
-$ratatoeskr_settings = new Settings("rw");
+$ratatoeskr_settings = NULL;
/*
* Class: DoesNotExistError
@@ -911,6 +911,8 @@ class Settings implements Countable, ArrayAccess, IteratorAggregate
public function getIterator() { return new SettingsIterator($this); }
}
+$ratatoeskr_settings = new Settings("rw");
+
/*
* Class: PluginKVStorage
* A Key-Value-Storage for Plugins
diff --git a/ratatoeskr/sys/plugin_api.php b/ratatoeskr/sys/plugin_api.php
index 65e4c9c..6293c27 100644
--- a/ratatoeskr/sys/plugin_api.php
+++ b/ratatoeskr/sys/plugin_api.php
@@ -38,10 +38,10 @@ abstract class RatatoeskrPlugin
* Variables: Protected variables
*
* $kvstorage - The Key-Value-Storage for the Plugin.
- * $smarty - Access to the global smarty object.
+ * $ste - Access to the global STECore object.
*/
protected $kvstorage;
- protected $smarty;
+ protected $ste;
/*
@@ -54,11 +54,11 @@ abstract class RatatoeskrPlugin
*/
public function __construct($id)
{
- global $smarty;
+ global $ste;
$this->id = $id;
$this->kvstorage = new PluginKVStorage($id);
- $this->smarty = $smarty;
+ $this->ste = $ste;
}
/*
@@ -70,7 +70,7 @@ abstract class RatatoeskrPlugin
*/
final public function get_id() { return $this->id; }
final protected function get_additional_files_dir() { return dirname(dirname(__FILE__)) . "/plugin_extradata/" . $this->id; }
- final protected function get_template_dir() { return dirname(dirname(__FILE__)) . "/templates/plugintemplates/" . $this->id; }
+ final protected function get_template_dir() { return dirname(dirname(__FILE__)) . "/templates/src/plugintemplates/" . $this->id; }
/*
* Function: register_url_handler
@@ -85,7 +85,7 @@ abstract class RatatoeskrPlugin
register_url_handler($name, array($this, $objfunction));
}
- final protected function register_settings_page($get, $validate, $set, $structure)
+ /*final protected function register_settings_page($get, $validate, $set, $structure)*/
/*
* Functions: Functions that are called at special events
diff --git a/ratatoeskr/sys/translation.php b/ratatoeskr/sys/translation.php
new file mode 100644
index 0000000..01f7c6d
--- /dev/null
+++ b/ratatoeskr/sys/translation.php
@@ -0,0 +1,55 @@
+<?php
+/*
+ * File: ratatoeskr/backend/main.php
+ * Load translation.
+ *
+ * License:
+ * This file is part of Ratatöskr.
+ * Ratatöskr is licensed unter the MIT / X11 License.
+ * See "ratatoeskr/licenses/ratatoeskr" for more information.
+ */
+
+require_once(dirname(__FILE__) . "/models.php");
+require_once(dirname(__FILE__) . "/init_ste.php");
+
+if(!defined(TRANSLATION_PLUGIN_LOADED))
+{
+ $ste->register_tag(
+ "get_translation",
+ function($ste, $params, $sub)
+ {
+ global $translation;
+ if((!isset($translation)) or empty($params["for"]) or (!isset($translation[$params["for"]])))
+ return "";
+ return $translation[$params["for"]];
+ }
+ );
+ define(TRANSLATION_PLUGIN_LOADED, True);
+}
+
+/*
+ * Function: load_language
+ * Load a language (i.e. set the global $translation variable).
+ *
+ * Parameters:
+ * $lang - The language (2-Letter code, e.g. "en", "de", "it" ...) to load. NULL for default (from database).
+ */
+function load_language($lang=NULL)
+{
+ global $ratatoeskr_settings;
+ if($lang === NULL)
+ $lang = $ratatoeskr_settings["default_language"];
+
+ /*
+ * Because we will include an file defined by the $lang param, we will
+ * only allow alphabetic characters, so this function should not be
+ * vulnerable to LFI-Exploits...
+ */
+ $lang = implode("", array_filter(str_split($lang, 1), "ctype_alpha"));
+
+ require(dirname(__FILE__) . "/../translations/$lang.php");
+
+ $GLOBALS["translation"] = $translation;
+}
+
+?>
diff --git a/ratatoeskr/templates/.htaccess b/ratatoeskr/templates/.htaccess
index 19469bf..19469bf 100644..100755
--- a/ratatoeskr/templates/.htaccess
+++ b/ratatoeskr/templates/.htaccess
diff --git a/ratatoeskr/templates/src/systemtemplates/backend_login.html b/ratatoeskr/templates/src/systemtemplates/backend_login.html
new file mode 100755
index 0000000..84b4cd9
--- /dev/null
+++ b/ratatoeskr/templates/src/systemtemplates/backend_login.html
@@ -0,0 +1,34 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-us" lang="en">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <meta http-equiv="Content-Style-Type" content="text/css" />
+ <title>Login - Ratatöskr</title>
+ <link rel="stylesheet" type="text/css" media="screen" href="$rel_path_to_root/ratatoeskr/cms_style/login.css" />
+</head>
+<body>
+ <img id="background_image" src="$rel_path_to_root/ratatoeskr/cms_style/images/login_bg.jpg" alt="" />
+ <div id="main">
+ <div id="bar_top"><strong>Ratatöskr</strong>::Noctilucent clouds (v. 0.1)</div>
+ <div class="vcenter_outer"><div class="vcenter_inner">
+ <div id="login_box">
+ <h1><ste:escape><ste:get_translation for="login_form_header" /></ste:escape></h1>
+ <ste:if>
+ $login_failed
+ <ste:then>
+ <div class="error">
+ <ste:escape><ste:get_translation for="login_failed" /></ste:escape>
+ </div>
+ </ste:then>
+ </ste:if>
+ <p><ste:escape><ste:capitalize><ste:get_translation for="username" /></ste:capitalize></ste:escape>: <input type="text" name="user" /></p>
+ <p><ste:escape><ste:capitalize><ste:get_translation for="password" /></ste:capitalize></ste:escape>: <input type="password" name="password" /></p>
+ <p class="loginbtn"><input type="submit" value="<ste:escape><ste:get_translation for='login_form_button' /></ste:escape>" /></p>
+ </div>
+ </div></div>
+ <div id="image_copyright">
+ <ste:l10n_replace URL="http://en.wikipedia.org/wiki/File:Helkivad_ööpilved_Kuresoo_kohal.jpg" FILENAME="Helkivad ööpilved Kuresoo kohal.jpg" AUTHOR="Martin Koitmäe" LICENSE="<a href=\"http://creativecommons.org/licenses/by-sa/3.0/deed.en\">CC BY-SA</a>"><ste:get_translation for="login_background_image" /></ste:l10n_replace>
+ </div>
+ </div>
+</body>
+</html>
diff --git a/ratatoeskr/templates/systemtemplates/backend_login.html b/ratatoeskr/templates/systemtemplates/backend_login.html
deleted file mode 100644
index 24738d2..0000000
--- a/ratatoeskr/templates/systemtemplates/backend_login.html
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!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">
-<head>
- <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
- <title>Login - Ratatöskr</title>
- <link rel="stylesheet" href="{$rel_path_to_root}/ratatoeskr/cms_style/login.css" type="text/css" charset="utf-8" />
-</head>
-<body>
-
-</body>
-</html>
diff --git a/ratatoeskr/templates/usertemplates/foo.tpl b/ratatoeskr/templates/usertemplates/foo.tpl
deleted file mode 100644
index af1564c..0000000
--- a/ratatoeskr/templates/usertemplates/foo.tpl
+++ /dev/null
@@ -1,14 +0,0 @@
-<{*HEADER
-Ratatoeskr template
-DO NOT REMOVE THIS COMMENT!
------BEGIN META-----
-{
- "Content-Type": "text/html",
- "ACL": {
- "users": ["foo"],
- "groups": [],
- "rights": {"users": ["read", "write", "delete"], "groups": ["read"], "others": ["read"]}
- }, "author": "Kevin Chabowski"
-}
------END META-----
-/HEADER*}>
diff --git a/ratatoeskr/tmp/smarty/.gitignore b/ratatoeskr/tmp/smarty/.gitignore
deleted file mode 100644
index ee31da6..0000000
--- a/ratatoeskr/tmp/smarty/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-cache
-templates_c
diff --git a/ratatoeskr/tmp/smarty/INFO b/ratatoeskr/tmp/smarty/INFO
deleted file mode 100644
index fe980f1..0000000
--- a/ratatoeskr/tmp/smarty/INFO
+++ /dev/null
@@ -1,6 +0,0 @@
-Temp / Cache dir for smarty
-needs two subdirectories: "templates_c" and "cache". The server needs full file
-access (rwx) to both of them. Usually you can do this by set the group to
-"apache" or "nobody" and then `chmod 775`, or if you do not have the rights to
-set the group: `chmod 777`, but this usually not a good idea (because everyone
-can now see this files), so only do this if you can not set the group.
diff --git a/ratatoeskr/translations/en.php b/ratatoeskr/translations/en.php
index c7bcf06..20c87b9 100644
--- a/ratatoeskr/translations/en.php
+++ b/ratatoeskr/translations/en.php
@@ -1,7 +1,12 @@
<?php
$translation = array(
-
+ "username" => "username",
+ "password" => "password",
+ "login_form_header" => "Login",
+ "login_form_button" => "Login",
+ "login_background_image" => "Background image: <a href=\"[[URL]]\">[[FILENAME]]</a> by [[AUTHOR]]. License: [[LICENSE]]",
+ "login_failed" => "Login failed."
);
?>