Index: includes/common.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/common.inc,v retrieving revision 1.315 diff -u -r1.315 common.inc --- includes/common.inc 26 Jan 2004 19:22:21 -0000 1.315 +++ includes/common.inc 26 Jan 2004 22:10:35 -0000 @@ -934,10 +934,6 @@ 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", ""))) : ""; -} /* @} */ /** Index: modules/blog.module =================================================================== RCS file: /cvs/drupal/drupal/modules/blog.module,v retrieving revision 1.160 diff -u -r1.160 blog.module --- modules/blog.module 23 Jan 2004 18:42:43 -0000 1.160 +++ modules/blog.module 26 Jan 2004 22:10:37 -0000 @@ -186,7 +186,7 @@ $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; } Index: modules/book.module =================================================================== RCS file: /cvs/drupal/drupal/modules/book.module,v retrieving revision 1.213 diff -u -r1.213 book.module --- modules/book.module 23 Jan 2004 18:42:43 -0000 1.213 +++ modules/book.module 26 Jan 2004 22:10:40 -0000 @@ -190,7 +190,7 @@ $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")) { Index: modules/comment.module =================================================================== RCS file: /cvs/drupal/drupal/modules/comment.module,v retrieving revision 1.212 diff -u -r1.212 comment.module --- modules/comment.module 26 Jan 2004 19:22:22 -0000 1.212 +++ modules/comment.module 26 Jan 2004 22:10:47 -0000 @@ -150,7 +150,7 @@ 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 @@ $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"]); Index: modules/filter.module =================================================================== RCS file: /cvs/drupal/drupal/modules/filter.module,v retrieving revision 1.3 diff -u -r1.3 filter.module --- modules/filter.module 19 Jan 2004 14:49:53 -0000 1.3 +++ modules/filter.module 26 Jan 2004 22:10:48 -0000 @@ -7,12 +7,32 @@ 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", "
      • ")) { + return t("Allowed HTML tags") .": ". htmlspecialchars($allowed_html); + } else { + return t("No HTML tags allowed"); + } + break; + case 2: + return t("No HTML tags allowed"); + break; + } + break; } } function filter_link($type) { - if ($type == "system" && user_access("administer site configuration")) { - menu("admin/system/filters", t("filters"), "filter_admin", 5); + if ($type == "system") { + if (user_access("administer site configuration")) { + menu("admin/system/filters", t("filters"), "filter_admin", 5); + } + menu("filter/tips", t("Compose tips"), "filter_tips_page", 0, MENU_HIDE); } } @@ -159,4 +179,17 @@ return $text; } -?> \ No newline at end of file +function filter_tips_page() { + $tips = module_invoke_all("help", "filter#tip"); + foreach ($tips as $tip) { + $tiplist .= "
      • $tip
      • \n"; + } + $output = "
          \n$tiplist\n
        \n"; + print theme("page", $output, t("Compose Tips")); +} + +function filter_tips_short() { + return filter_help("filter#tip") . "
        " . l(t("More information on formatting options"), "filter/tips", array("target" => "_blank")); +} + +?> Index: modules/story.module =================================================================== RCS file: /cvs/drupal/drupal/modules/story.module,v retrieving revision 1.141 diff -u -r1.141 story.module --- modules/story.module 23 Jan 2004 18:42:43 -0000 1.141 +++ modules/story.module 26 Jan 2004 22:10:49 -0000 @@ -82,7 +82,7 @@ $output .= implode("", taxonomy_node_form("story", $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; }