theme_filter_tips

  1. drupal
    1. drupal6
    2. drupal7
Versionen
drupal6 theme_filter_tips($tips, $long = FALSE, $extra = '')
drupal7 theme_filter_tips($tips, $long = FALSE)

Render HTML for a set of filter tips.

Übergabeparameter

$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:

<?php

    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()

Verwandte Themen

Code

modules/filter/filter.pages.inc, line 51

<?php
function theme_filter_tips($tips, $long = FALSE) {
  $output = '';

  $multiple = count($tips) > 1;
  if ($multiple) {
    $output = t('Text 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;
}
?>

Kommentare

Kommentar hinzufügen

Der Inhalt dieses Feldes wird nicht öffentlich zugänglich angezeigt.
  • Internet- und E-Mail-Adressen werden automatisch umgewandelt.
  • Zulässige HTML-Tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Zeilen und Absätze werden automatisch erzeugt.

Weitere Informationen über Formatierungsoptionen

Kommentar hinzufügen

Der Inhalt dieses Feldes wird nicht öffentlich zugänglich angezeigt.
  • Internet- und E-Mail-Adressen werden automatisch umgewandelt.
  • Zulässige HTML-Tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Zeilen und Absätze werden automatisch erzeugt.

Weitere Informationen über Formatierungsoptionen