Index: filter.module =================================================================== RCS file: /cvs/drupal/drupal/modules/filter.module,v retrieving revision 1.3 diff -u -r1.3 filter.module --- filter.module 19 Jan 2004 14:49:53 -0000 1.3 +++ filter.module 25 Jan 2004 13:09:26 -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", 0, MENU_HIDE); } } @@ -159,4 +179,19 @@ return $text; } -?> \ No newline at end of file +function filter_tips() { + $tips = module_invoke_all("help", "filter#tip"); + foreach ($tips as $tip) { + $tiplist .= "
      • $tip
      • \n"; + } + $output = "

        \n
          \n$tiplist\n
        \n"; + print theme("page", $output, t("Compose Tips")); +} + +function filter_nodeapi($edit, $op) { + if ($op == "form post") { + return array("

        » ". l(t("Writing and formatting tips"), "filter/tips"). "

        "); + } +} + +?>