From 02c622dea123ff89ca45d19bd4ee402f8cf74a00 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Tue, 27 Jan 2004 22:10:47 +0000 Subject: [PATCH] - Patch 4332 by Goba: eliminate compose tips module. --- includes/common.inc | 4 ---- modules/blog.module | 2 +- modules/blog/blog.module | 2 +- modules/book.module | 2 +- modules/book/book.module | 2 +- modules/comment.module | 4 ++-- modules/comment/comment.module | 4 ++-- modules/filter.module | 41 +++++++++++++++++++++++++++++++--- modules/filter/filter.module | 41 +++++++++++++++++++++++++++++++--- modules/story.module | 2 +- modules/story/story.module | 2 +- 11 files changed, 86 insertions(+), 20 deletions(-) diff --git a/includes/common.inc b/includes/common.inc index 8d6cdcc4123f..bc8c5756499a 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -934,10 +934,6 @@ function form_weight($title = NULL, $name = "weight", $value = 0, $delta = 10, $ return form_select($title, $name, $value, $weights, $description, $extra); } - -function form_allowed_tags_text() { - return variable_get("allowed_html", "") ? (t("Allowed HTML tags") .": ". htmlspecialchars(variable_get("allowed_html", ""))) : ""; -} /* @} */ /** diff --git a/modules/blog.module b/modules/blog.module index 9b091b735995..159b7ff9881a 100644 --- a/modules/blog.module +++ b/modules/blog.module @@ -184,7 +184,7 @@ function blog_form(&$node, &$error) { $output .= implode("", taxonomy_node_form("blog", $node)); } - $output .= form_textarea(t("Body"), "body", $node->body, 60, 15, $error["body"] ? $error["body"] : form_allowed_tags_text()); + $output .= form_textarea(t("Body"), "body", $node->body, 60, 15, $error["body"] ? $error["body"] : filter_tips_short()); return $output; } diff --git a/modules/blog/blog.module b/modules/blog/blog.module index 9b091b735995..159b7ff9881a 100644 --- a/modules/blog/blog.module +++ b/modules/blog/blog.module @@ -184,7 +184,7 @@ function blog_form(&$node, &$error) { $output .= implode("", taxonomy_node_form("blog", $node)); } - $output .= form_textarea(t("Body"), "body", $node->body, 60, 15, $error["body"] ? $error["body"] : form_allowed_tags_text()); + $output .= form_textarea(t("Body"), "body", $node->body, 60, 15, $error["body"] ? $error["body"] : filter_tips_short()); return $output; } diff --git a/modules/book.module b/modules/book.module index b97c76f5da8a..92abb07db8ce 100644 --- a/modules/book.module +++ b/modules/book.module @@ -185,7 +185,7 @@ function book_form(&$node, &$error) { $output .= implode("", taxonomy_node_form("book", $node)); } - $output .= form_textarea(t("Body"), "body", $node->body, 60, 20, form_allowed_tags_text()); + $output .= form_textarea(t("Body"), "body", $node->body, 60, 20, filter_tips_short()); $output .= form_textarea(t("Log message"), "log", $node->log, 60, 5, t("An explanation of the additions or updates being made to help the group understand your motivations.")); if (user_access("administer nodes")) { diff --git a/modules/book/book.module b/modules/book/book.module index b97c76f5da8a..92abb07db8ce 100644 --- a/modules/book/book.module +++ b/modules/book/book.module @@ -185,7 +185,7 @@ function book_form(&$node, &$error) { $output .= implode("", taxonomy_node_form("book", $node)); } - $output .= form_textarea(t("Body"), "body", $node->body, 60, 20, form_allowed_tags_text()); + $output .= form_textarea(t("Body"), "body", $node->body, 60, 20, filter_tips_short()); $output .= form_textarea(t("Log message"), "log", $node->log, 60, 5, t("An explanation of the additions or updates being made to help the group understand your motivations.")); if (user_access("administer nodes")) { diff --git a/modules/comment.module b/modules/comment.module index 4e78e7677b61..9c937dde0ed8 100644 --- a/modules/comment.module +++ b/modules/comment.module @@ -150,7 +150,7 @@ function comment_user($type, $edit, &$user) { break; case "edit_form": // when user tries to edit his own data - return form_textarea(t("Signature"), "signature", $user->signature, 70, 3, t("Your signature will be publicly displayed at the end of your comments.") ."
". form_allowed_tags_text()); + return form_textarea(t("Signature"), "signature", $user->signature, 70, 3, t("Your signature will be publicly displayed at the end of your comments.") ."
". filter_tips_short()); case "edit_validate": // validate user data editing return array("signature" => $edit["signature"]); @@ -1259,7 +1259,7 @@ function theme_comment_form($edit, $title) { $form .= form_textfield(t("Subject"), "subject", $edit["subject"], 50, 64); // comment field: - $form .= form_textarea(t("Comment"), "comment", $edit["comment"] ? $edit["comment"] : $user->signature, 70, 10, form_allowed_tags_text()); + $form .= form_textarea(t("Comment"), "comment", $edit["comment"] ? $edit["comment"] : $user->signature, 70, 10, filter_tips_short()); // preview button: $form .= form_hidden("cid", $edit["cid"]); diff --git a/modules/comment/comment.module b/modules/comment/comment.module index 4e78e7677b61..9c937dde0ed8 100644 --- a/modules/comment/comment.module +++ b/modules/comment/comment.module @@ -150,7 +150,7 @@ function comment_user($type, $edit, &$user) { break; case "edit_form": // when user tries to edit his own data - return form_textarea(t("Signature"), "signature", $user->signature, 70, 3, t("Your signature will be publicly displayed at the end of your comments.") ."
". form_allowed_tags_text()); + return form_textarea(t("Signature"), "signature", $user->signature, 70, 3, t("Your signature will be publicly displayed at the end of your comments.") ."
". filter_tips_short()); case "edit_validate": // validate user data editing return array("signature" => $edit["signature"]); @@ -1259,7 +1259,7 @@ function theme_comment_form($edit, $title) { $form .= form_textfield(t("Subject"), "subject", $edit["subject"], 50, 64); // comment field: - $form .= form_textarea(t("Comment"), "comment", $edit["comment"] ? $edit["comment"] : $user->signature, 70, 10, form_allowed_tags_text()); + $form .= form_textarea(t("Comment"), "comment", $edit["comment"] ? $edit["comment"] : $user->signature, 70, 10, filter_tips_short()); // preview button: $form .= form_hidden("cid", $edit["cid"]); diff --git a/modules/filter.module b/modules/filter.module index d17e21df533c..b812e64049e8 100644 --- a/modules/filter.module +++ b/modules/filter.module @@ -7,12 +7,32 @@ function filter_help($section = "admin/help#filter") { return t("Framework for handling filtering of content."); case 'admin/system/filters': return t("Filters fit between the raw text in a node and the HTML output. They allow you to replace text selectively. Uses include automatic conversion of emoticons into graphics and filtering HTML content from users' submissions."); + case 'filter#tip': + switch (variable_get("filter_html", 1)) { + case 0: + return t("All HTML tags allowed"); + break; + case 1: + if ($allowed_html = variable_get("allowed_html", "