From fcb9011d880d7d3793425102a6f06b4678866abc Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Sat, 31 Jan 2004 10:18:51 +0000 Subject: - Modified filter patch by Ax. --- modules/filter.module | 26 +++++++++++++++++--------- modules/filter/filter.module | 26 +++++++++++++++++--------- 2 files changed, 34 insertions(+), 18 deletions(-) (limited to 'modules') diff --git a/modules/filter.module b/modules/filter.module index b812e6404..e41f6d2a4 100644 --- a/modules/filter.module +++ b/modules/filter.module @@ -7,7 +7,8 @@ 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': + case 'filter#long-tip': + case 'filter#short-tip': switch (variable_get("filter_html", 1)) { case 0: return t("All HTML tags allowed"); @@ -32,7 +33,7 @@ function filter_link($type) { 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); + menu("filter/tips", t("Compose tips"), "filter_tips_long", 0, MENU_HIDE); } } @@ -179,19 +180,26 @@ function filter_old_urls($text) { return $text; } -function filter_tips_page() { - $tips = module_invoke_all("help", "filter#tip"); - foreach ($tips as $tip) { - if ($tip) { - $tiplist .= "
  • $tip
  • \n"; +function filter_tips_long() { + $tiplist = ''; + foreach (module_list() as $name) { + if ($tip = module_invoke($name, 'help', 'filter#long-tip')) { + $tiplist .= "
  • $tip
  • \n"; } } $output = "\n"; - print theme("page", $output, t("Compose Tips")); + 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")); + $output = ''; + foreach (module_list() as $name) { + if ($tip = module_invoke($name, 'help', 'filter#short-tip')) { + $output .= "$tip
    "; + } + } + $output .= l(t('More information on formatting options'), 'filter/tips'); + return $output; } ?> diff --git a/modules/filter/filter.module b/modules/filter/filter.module index b812e6404..e41f6d2a4 100644 --- a/modules/filter/filter.module +++ b/modules/filter/filter.module @@ -7,7 +7,8 @@ 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': + case 'filter#long-tip': + case 'filter#short-tip': switch (variable_get("filter_html", 1)) { case 0: return t("All HTML tags allowed"); @@ -32,7 +33,7 @@ function filter_link($type) { 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); + menu("filter/tips", t("Compose tips"), "filter_tips_long", 0, MENU_HIDE); } } @@ -179,19 +180,26 @@ function filter_old_urls($text) { return $text; } -function filter_tips_page() { - $tips = module_invoke_all("help", "filter#tip"); - foreach ($tips as $tip) { - if ($tip) { - $tiplist .= "
  • $tip
  • \n"; +function filter_tips_long() { + $tiplist = ''; + foreach (module_list() as $name) { + if ($tip = module_invoke($name, 'help', 'filter#long-tip')) { + $tiplist .= "
  • $tip
  • \n"; } } $output = "\n"; - print theme("page", $output, t("Compose Tips")); + 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")); + $output = ''; + foreach (module_list() as $name) { + if ($tip = module_invoke($name, 'help', 'filter#short-tip')) { + $output .= "$tip
    "; + } + } + $output .= l(t('More information on formatting options'), 'filter/tips'); + return $output; } ?> -- cgit v1.2.3