| Versions | |
|---|---|
| 4.7 | theme_filter_tips($tips, $long = false, $extra = '') |
| 5 – 6 | theme_filter_tips( |
| 7 | theme_filter_tips($variables) |
Returns HTML for a set of filter tips.
$variables An associative array containing:
<?php
array(
'Full HTML' => array(
0 => array(
'tip' => 'Web page addresses and e-mail addresses turn into links automatically.',
'id' => 'filter/2',
),
),
);
?>drupal/
<?php
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>' . $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;
}
?>