diff options
author | Kevin Chabowski <kevin@kch42.de> | 2011-11-17 22:17:48 +0100 |
---|---|---|
committer | Kevin Chabowski <kevin@kch42.de> | 2011-11-17 22:17:48 +0100 |
commit | cc9d722cf738da41224c7c803a27c2532da73beb (patch) | |
tree | f78232c0847dc6c2a01c84a4cfe92b72a8e84010 /ratatoeskr/sys/translation.php | |
parent | 2ec78d505342e2bc241b32eac29164994ed911eb (diff) | |
download | ratatoeskr-cms-cc9d722cf738da41224c7c803a27c2532da73beb.tar.gz ratatoeskr-cms-cc9d722cf738da41224c7c803a27c2532da73beb.tar.bz2 ratatoeskr-cms-cc9d722cf738da41224c7c803a27c2532da73beb.zip |
ste:get_translation now escapes HTML.
So we do not longer need to write:
<ste:escape><ste:get_translation for="foo" /></ste:escape>
We can now omit the ste:escape tags.
Setting the parameter raw to something non-empty will return the raw
translation.
Diffstat (limited to 'ratatoeskr/sys/translation.php')
-rw-r--r-- | ratatoeskr/sys/translation.php | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/ratatoeskr/sys/translation.php b/ratatoeskr/sys/translation.php index cd40f85..ca43c13 100644 --- a/ratatoeskr/sys/translation.php +++ b/ratatoeskr/sys/translation.php @@ -10,6 +10,7 @@ */ require_once(dirname(__FILE__) . "/models.php"); +require_once(dirname(__FILE__) . "/utils.php"); require_once(dirname(__FILE__) . "/init_ste.php"); if(!defined(TRANSLATION_PLUGIN_LOADED)) @@ -21,7 +22,8 @@ if(!defined(TRANSLATION_PLUGIN_LOADED)) global $translation; if((!isset($translation)) or empty($params["for"]) or (!isset($translation[$params["for"]]))) return ""; - return $translation[$params["for"]]; + $rv = $translation[$params["for"]]; + return (!empty($params["raw"])) ? $rv : htmlesc($rv); } ); define(TRANSLATION_PLUGIN_LOADED, True); |