00001 <?php
00002
00003
00013 function filter_tips_long() {
00014 $format = arg(2);
00015 if ($format) {
00016 $output = theme('filter_tips', _filter_tips($format, TRUE), TRUE);
00017 }
00018 else {
00019 $output = theme('filter_tips', _filter_tips(-1, TRUE), TRUE);
00020 }
00021 return $output;
00022 }
00023
00024
00030 function theme_filter_tips($tips, $long = FALSE, $extra = '') {
00031 $output = '';
00032
00033 $multiple = count($tips) > 1;
00034 if ($multiple) {
00035 $output = t('input formats') . ':';
00036 }
00037
00038 if (count($tips)) {
00039 if ($multiple) {
00040 $output .= '<ul>';
00041 }
00042 foreach ($tips as $name => $tiplist) {
00043 if ($multiple) {
00044 $output .= '<li>';
00045 $output .= '<strong>' . $name . '</strong>:<br />';
00046 }
00047
00048 if (count($tiplist) > 0) {
00049 $output .= '<ul class="tips">';
00050 foreach ($tiplist as $tip) {
00051 $output .= '<li' . ($long ? ' id="filter-' . str_replace("/", "-", $tip['id']) . '">' : '>') . $tip['tip'] . '</li>';
00052 }
00053 $output .= '</ul>';
00054 }
00055
00056 if ($multiple) {
00057 $output .= '</li>';
00058 }
00059 }
00060 if ($multiple) {
00061 $output .= '</ul>';
00062 }
00063 }
00064
00065 return $output;
00066 }