You are here

function theme_filter_tips in Drupal 5

Same name and namespace in other branches
  1. 4 modules/filter.module \theme_filter_tips()
  2. 6 modules/filter/filter.pages.inc \theme_filter_tips()
  3. 7 modules/filter/filter.pages.inc \theme_filter_tips()

Format a set of filter tips.

Related topics

3 theme calls to theme_filter_tips()
filter_admin_format_form in modules/filter/filter.module
Generate a filter format form.
filter_form in modules/filter/filter.module
Generate a selector for choosing a format in a form.
filter_tips_long in modules/filter/filter.module
Menu callback; show a page with long filter tips.

File

modules/filter/filter.module, line 931
Framework for handling filtering of content.

Code

function theme_filter_tips($tips, $long = FALSE, $extra = '') {
  $output = '';
  $multiple = count($tips) > 1;
  if ($multiple) {
    $output = t('input formats') . ':';
  }
  if (count($tips)) {
    if ($multiple) {
      $output .= '<ul>';
    }
    foreach ($tips as $name => $tiplist) {
      if ($multiple) {
        $output .= '<li>';
        $output .= '<strong>' . $name . '</strong>:<br />';
      }
      if (count($tiplist) > 0) {
        $output .= '<ul class="tips">';
        foreach ($tiplist as $tip) {
          $output .= '<li' . ($long ? ' id="filter-' . str_replace("/", "-", $tip['id']) . '">' : '>') . $tip['tip'] . '</li>';
        }
        $output .= '</ul>';
      }
      if ($multiple) {
        $output .= '</li>';
      }
    }
    if ($multiple) {
      $output .= '</ul>';
    }
  }
  return $output;
}