Code coverage for /20081101/modules/filter/filter.pages.inc

Line #Times calledCode
1
<?php
2
// $Id: filter.pages.inc,v 1.3 2008/04/14 17:48:37 dries Exp $
3
4
/**
5
 * @file
6
 * User page callbacks for the filter module.
7
 */
8
9
10
/**
11
 * Menu callback; show a page with long filter tips.
12
 */
13384
function filter_tips_long() {
140
  $format = arg(2);
150
  if ($format) {
160
    $output = theme('filter_tips', _filter_tips($format, TRUE), TRUE);
170
  }
18
  else {
190
    $output = theme('filter_tips', _filter_tips(-1, TRUE), TRUE);
20
  }
210
  return $output;
220
}
23
24
25
/**
26
 * Format a set of filter tips.
27
 *
28
 * @ingroup themeable
29
 */
30384
function theme_filter_tips($tips, $long = FALSE, $extra = '') {
31206
  $output = '';
32
33206
  $multiple = count($tips) > 1;
34206
  if ($multiple) {
350
    $output = t('input formats') . ':';
360
  }
37
38206
  if (count($tips)) {
39206
    if ($multiple) {
400
      $output .= '<ul>';
410
    }
42206
    foreach ($tips as $name => $tiplist) {
43206
      if ($multiple) {
440
        $output .= '<li>';
450
        $output .= '<strong>' . $name . '</strong>:<br />';
460
      }
47
48206
      if (count($tiplist) > 0) {
49206
        $output .= '<ul class="tips">';
50206
        foreach ($tiplist as $tip) {
51206
          $output .= '<li' . ($long ? ' id="filter-' . str_replace("/",
"-", $tip['id']) . '">' : '>') . $tip['tip'] . '</li>';
52206
        }
53206
        $output .= '</ul>';
54206
      }
55
56206
      if ($multiple) {
570
        $output .= '</li>';
580
      }
59206
    }
60206
    if ($multiple) {
610
      $output .= '</ul>';
620
    }
63206
  }
64
65206
  return $output;
660
}
67384