filter.pages.inc

  1. 7.x drupal-7.x/modules/filter/filter.pages.inc
  2. 6.x drupal-6.x/modules/filter/filter.pages.inc

User page callbacks for the filter module.

File

drupal-6.x/modules/filter/filter.pages.inc
View source
  1. <?php
  2. /**
  3. * @file
  4. * User page callbacks for the filter module.
  5. */
  6. /**
  7. * Menu callback; show a page with long filter tips.
  8. */
  9. function filter_tips_long() {
  10. $format = arg(2);
  11. if ($format) {
  12. $output = theme('filter_tips', _filter_tips($format, TRUE), TRUE);
  13. }
  14. else {
  15. $output = theme('filter_tips', _filter_tips(-1, TRUE), TRUE);
  16. }
  17. return $output;
  18. }
  19. /**
  20. * Format a set of filter tips.
  21. *
  22. * @ingroup themeable
  23. */
  24. function theme_filter_tips($tips, $long = FALSE, $extra = '') {
  25. $output = '';
  26. $multiple = count($tips) > 1;
  27. if ($multiple) {
  28. $output = t('input formats') .':';
  29. }
  30. if (count($tips)) {
  31. if ($multiple) {
  32. $output .= '<ul>';
  33. }
  34. foreach ($tips as $name => $tiplist) {
  35. if ($multiple) {
  36. $output .= '<li>';
  37. $output .= '<strong>'. $name .'</strong>:<br />';
  38. }
  39. if (count($tiplist) > 0) {
  40. $output .= '<ul class="tips">';
  41. foreach ($tiplist as $tip) {
  42. $output .= '<li'. ($long ? ' id="filter-'. str_replace("/", "-", $tip['id']) .'">' : '>') . $tip['tip'] .'</li>';
  43. }
  44. $output .= '</ul>';
  45. }
  46. if ($multiple) {
  47. $output .= '</li>';
  48. }
  49. }
  50. if ($multiple) {
  51. $output .= '</ul>';
  52. }
  53. }
  54. return $output;
  55. }