diff options
author | Dries Buytaert <dries@buytaert.net> | 2004-01-31 10:18:51 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2004-01-31 10:18:51 +0000 |
commit | fcb9011d880d7d3793425102a6f06b4678866abc (patch) | |
tree | 7f21477e008fb8db2724c4f407e0dab3676f3d32 | |
parent | 384ae54cf67454ba5dfb2a4d01575359b4fc3ffc (diff) | |
download | brdo-fcb9011d880d7d3793425102a6f06b4678866abc.tar.gz brdo-fcb9011d880d7d3793425102a6f06b4678866abc.tar.bz2 |
- Modified filter patch by Ax.
-rw-r--r-- | modules/filter.module | 26 | ||||
-rw-r--r-- | modules/filter/filter.module | 26 |
2 files changed, 34 insertions, 18 deletions
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 .= "<li>$tip</li>\n"; +function filter_tips_long() { + $tiplist = ''; + foreach (module_list() as $name) { + if ($tip = module_invoke($name, 'help', 'filter#long-tip')) { + $tiplist .= "<li id=\"filter-$name\">$tip</li>\n"; } } $output = "<ul class=\"compose-tips\">\n$tiplist\n</ul>\n"; - print theme("page", $output, t("Compose Tips")); + print theme("page", $output, t('Compose Tips')); } function filter_tips_short() { - return filter_help("filter#tip") . "<br />" . 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<br />"; + } + } + $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 .= "<li>$tip</li>\n"; +function filter_tips_long() { + $tiplist = ''; + foreach (module_list() as $name) { + if ($tip = module_invoke($name, 'help', 'filter#long-tip')) { + $tiplist .= "<li id=\"filter-$name\">$tip</li>\n"; } } $output = "<ul class=\"compose-tips\">\n$tiplist\n</ul>\n"; - print theme("page", $output, t("Compose Tips")); + print theme("page", $output, t('Compose Tips')); } function filter_tips_short() { - return filter_help("filter#tip") . "<br />" . 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<br />"; + } + } + $output .= l(t('More information on formatting options'), 'filter/tips'); + return $output; } ?> |