Code coverage for /20080809/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
 */
13222
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
 */
30222
function theme_filter_tips($tips, $long = FALSE, $extra = '') {
31131
  $output = '';
32
33131
  $multiple = count($tips) > 1;
34131
  if ($multiple) {
350
    $output = t('input formats') . ':';
360
  }
37
38131
  if (count($tips)) {
39131
    if ($multiple) {
400
      $output .= '<ul>';
410
    }
42131
    foreach ($tips as $name => $tiplist) {
43131
      if ($multiple) {
440
        $output .= '<li>';
450
        $output .= '<strong>' . $name . '</strong>:<br />';
460
      }
47
48131
      if (count($tiplist) > 0) {
49131
        $output .= '<ul class="tips">';
50131
        foreach ($tiplist as $tip) {
51131
          $output .= '<li' . ($long ? ' id="filter-' . str_replace("/",
"-", $tip['id']) . '">' : '>') . $tip['tip'] . '</li>';
52131
        }
53131
        $output .= '</ul>';
54131
      }
55
56131
      if ($multiple) {
570
        $output .= '</li>';
580
      }
59131
    }
60131
    if ($multiple) {
610
      $output .= '</ul>';
620
    }
63131
  }
64
65131
  return $output;
660
}
67222