4.6.x filter.module theme_filter_tips($tips, $long = false, $extra = '')
4.7.x filter.module theme_filter_tips($tips, $long = false, $extra = '')
5.x filter.module theme_filter_tips($tips, $long = FALSE, $extra = '')
6.x filter.pages.inc theme_filter_tips($tips, $long = FALSE, $extra = '')
7.x filter.pages.inc theme_filter_tips($variables)

Returns HTML for a set of filter tips.

Parameters

$variables: An associative array containing:

  • tips: An array containing descriptions and a CSS ID in the form of 'module-name/filter-id' (only used when $long is TRUE) for each filter in one or more text formats. Example:
array(
  'Full HTML' => array(
    0 => array(
      'tip' => 'Web page addresses and e-mail addresses turn into links automatically.',
      'id' => 'filter/2',
    ),
  ),
);
  • long: (optional) Whether the passed-in filter tips contain extended explanations, i.e. intended to be output on the path 'filter/tips' (TRUE), or are in a short format, i.e. suitable to be displayed below a form element. Defaults to FALSE.

See also

_filter_tips()

Related topics

2 theme calls to theme_filter_tips()
filter_tips_long in modules/filter/filter.pages.inc
Page callback: Displays a page with long filter tips.
theme_filter_guidelines in modules/filter/filter.module
Returns HTML for guidelines for a text format.

File

modules/filter/filter.pages.inc, line 53
User page callbacks for the Filter module.

Code

function theme_filter_tips($variables) {
  $tips = $variables['tips'];
  $long = $variables['long'];
  $output = '';
  $multiple = count($tips) > 1;
  if ($multiple) {
    $output = '<h2>' . t('Text Formats') . '</h2>';
  }
  if (count($tips)) {
    if ($multiple) {
      $output .= '<div class="compose-tips">';
    }
    foreach ($tips as $name => $tiplist) {
      if ($multiple) {
        $output .= '<div class="filter-type filter-' . drupal_html_class($name) . '">';
        $output .= '<h3>' . check_plain($name) . '</h3>';
      }
      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 .= '</div>';
      }
    }
    if ($multiple) {
      $output .= '</div>';
    }
  }
  return $output;
}

Comments

marcoka’s picture

get the filter tips with: $tips['tips'] = _filter_tips(2, FALSE);

where 2 is the filter_id you could get from $node

onequad’s picture

If 'Use the administration theme when editing or creating content ' option is selected, override this function in a custom theme doesn't appear to work because the admin theme is used on the editing page. This took me quite awhile to figure out. =="