aboutsummaryrefslogtreecommitdiff
path: root/ratatoeskr/backend.php
diff options
context:
space:
mode:
authorKevin Chabowski <kevin@kch42.de>2012-02-18 14:47:04 +0100
committerKevin Chabowski <kevin@kch42.de>2012-02-18 14:47:04 +0100
commitfffbcc480c8afa679e3a9ffee8c145dc3d4f5a28 (patch)
treeb246be90a632e5ae1e370dbe142f7e7ab26bd52f /ratatoeskr/backend.php
parenteb5f8764eebd5149ff4472d5a646943b9524f6b9 (diff)
downloadratatoeskr-cms-fffbcc480c8afa679e3a9ffee8c145dc3d4f5a28.tar.gz
ratatoeskr-cms-fffbcc480c8afa679e3a9ffee8c145dc3d4f5a28.tar.bz2
ratatoeskr-cms-fffbcc480c8afa679e3a9ffee8c145dc3d4f5a28.zip
Added embedding code generator for STE code.
Also fixed a bug that the pagetitle of the embedding code generator page was not displayed.
Diffstat (limited to 'ratatoeskr/backend.php')
-rw-r--r--ratatoeskr/backend.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/ratatoeskr/backend.php b/ratatoeskr/backend.php
index c24497e..bf7bb44 100644
--- a/ratatoeskr/backend.php
+++ b/ratatoeskr/backend.php
@@ -678,9 +678,9 @@ $backend_subactions = url_action_subactions(array(
throw new NotFoundError();
else
{
- if(($imageaction == "markdown") or ($imageaction == "html"))
+ if(($imageaction == "markdown") or ($imageaction == "html") or ($imageaction == "ste"))
{
- $ste->vars["pagetitle"] = $translations["generate_embed_code"];
+ $ste->vars["pagetitle"] = $translation["generate_embed_code"];
$ste->vars["image_id"] = $image->get_id();
$ste->vars["markup_variant"] = $imageaction;
if(isset($_POST["img_alt"]))
@@ -689,6 +689,8 @@ $backend_subactions = url_action_subactions(array(
$ste->vars["embed_code"] = "![" . str_replace("]", "\\]", $_POST["img_alt"]) . "](%root%/images/" . str_replace(")", "\\)", urlencode($image->get_filename())) . ")";
elseif($imageaction == "html")
$ste->vars["embed_code"] = "<img src=\"%root%/images/" . htmlesc(urlencode($image->get_filename())) . "\" alt=\"" . htmlesc($_POST["img_alt"]) . "\" />";
+ elseif($imageaction == "ste")
+ $ste->vars["embed_code"] = "<img src=\"\$rel_path_to_root/images/" . htmlesc(urlencode($image->get_filename())) . "\" alt=\"" . htmlesc($_POST["img_alt"]) . "\" />";
}
echo $ste->exectemplate("/systemtemplates/image_embed.html");