aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Chabowski <kevin@kch42.de>2012-05-21 23:11:02 +0200
committerKevin Chabowski <kevin@kch42.de>2012-05-21 23:11:02 +0200
commit71e6e63f2712d2075eca7fff5a45c73f1cfa383f (patch)
tree3f7ca1ed28d5d35a565c22b1c78f697990a0aae3
parent0915d74865b0cab61c3a505e802b80ac048cdd3f (diff)
downloadratatoeskr-cms-71e6e63f2712d2075eca7fff5a45c73f1cfa383f.tar.gz
ratatoeskr-cms-71e6e63f2712d2075eca7fff5a45c73f1cfa383f.tar.bz2
ratatoeskr-cms-71e6e63f2712d2075eca7fff5a45c73f1cfa383f.zip
ste:comment_form can now generate a previewbtn by default.
-rw-r--r--ratatoeskr/frontend.php9
-rw-r--r--ratatoeskr/translations/de.php2
-rw-r--r--ratatoeskr/translations/en.php2
3 files changed, 10 insertions, 3 deletions
diff --git a/ratatoeskr/frontend.php b/ratatoeskr/frontend.php
index 0bc083b..038485a 100644
--- a/ratatoeskr/frontend.php
+++ b/ratatoeskr/frontend.php
@@ -392,8 +392,9 @@ $ste->register_tag("article_comments", function($ste, $params, $sub)
* Generates a HTML form tag that allows the visitor to write a comment.
*
* Parameters:
- * article - (mandatory) The name of the variable, where the article is stored at.
- * default - (optional) If not empty, a default formular with the mandatory fields will be generated.
+ * article - (mandatory) The name of the variable, where the article is stored at.
+ * default - (optional) If not empty, a default formular with the mandatory fields will be generated.
+ * previewbtn - (optional) If not empty and default form is choosen, a preview button will also be generated.
*
* Tag Content:
* The tag's content will be written into the HTML form tag.
@@ -446,11 +447,13 @@ $ste->register_tag("comment_form", function($ste, $params, $sub)
$form_header = "<form action=\"{$tpl_article["fullurl"]}?comment\" method=\"post\" accept-charset=\"UTF-8\"><input type=\"hidden\" name=\"comment_token\" value=\"$token\" />";
+ $previewbtn = $ste->evalbool(@$params["previewbtn"]) ? " <input type=\"submit\" name=\"preview_comment\" value=\"{$translation["comment_form_preview"]}\" />" : "";
+
if($ste->evalbool(@$params["default"]))
$form_body = "<p>{$translation["comment_form_name"]}: <input type=\"text\" name=\"author_name\" value=\"" . htmlesc(@$_POST["author_name"]) . "\" /></p>
<p>{$translation["comment_form_mail"]}: <input type=\"text\" name=\"author_mail\" value=\"" . htmlesc(@$_POST["author_mail"]) . "\" /></p>
<p>{$translation["comment_form_text"]}:<br /><textarea name=\"comment_text\" cols=\"50\" rows=\"10\">" . htmlesc(@$_POST["comment_text"]) . "</textarea></p>
-<p><input type=\"submit\" name=\"post_comment\" /></p>";
+<p><input type=\"submit\" name=\"post_comment\" value=\"{$translation["comment_form_submit"]}\" />$previewbtn</p>";
else
{
$ste->vars["current"]["oldcomment"] = array(
diff --git a/ratatoeskr/translations/de.php b/ratatoeskr/translations/de.php
index 66c68d8..ecf94b8 100644
--- a/ratatoeskr/translations/de.php
+++ b/ratatoeskr/translations/de.php
@@ -33,6 +33,8 @@ $translation = array(
"comment_form_name" => "Dein Name",
"comment_form_mail" => "Deine E-Mailadresse",
"comment_form_text" => "Dein Kommentar (Markdown Format)",
+ "comment_form_submit" => "Kommentar senden",
+ "comment_form_preview" => "Vorschau",
"page_prev" => "&lt;-- vorherige Seite",
"page_next" => "nächste Seite --&gt;",
"e404_details" => "Die Seite [[URL]] konte nicht gefunden werden. Das tut uns leid.",
diff --git a/ratatoeskr/translations/en.php b/ratatoeskr/translations/en.php
index 27374c6..b2755fc 100644
--- a/ratatoeskr/translations/en.php
+++ b/ratatoeskr/translations/en.php
@@ -33,6 +33,8 @@ $translation = array(
"comment_form_name" => "Your name",
"comment_form_mail" => "Your E-Mailaddress",
"comment_form_text" => "Your comment (Markdown format)",
+ "comment_form_submit" => "Submit comment",
+ "comment_form_preview" => "Preview",
"page_prev" => "&lt;-- previous page",
"page_next" => "next page --&gt;",
"e404_details" => "The page [[URL]] could not be found. Sorry.",