[ Index ]

PHP Cross Reference of Drupal 6 (gatewave)

title

Body

[close]

/modules/filter/ -> filter.pages.inc (source)

   1  <?php
   2  // $Id: filter.pages.inc,v 1.2 2007/11/10 17:41:18 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   */
  13  function filter_tips_long() {
  14    $format = arg(2);
  15    if ($format) {
  16      $output = theme('filter_tips', _filter_tips($format, TRUE), TRUE);
  17    }
  18    else {
  19      $output = theme('filter_tips', _filter_tips(-1, TRUE), TRUE);
  20    }
  21    return $output;
  22  }
  23  
  24  
  25  /**
  26   * Format a set of filter tips.
  27   *
  28   * @ingroup themeable
  29   */
  30  function theme_filter_tips($tips, $long = FALSE, $extra = '') {
  31    $output = '';
  32  
  33    $multiple = count($tips) > 1;
  34    if ($multiple) {
  35      $output = t('input formats') .':';
  36    }
  37  
  38    if (count($tips)) {
  39      if ($multiple) {
  40        $output .= '<ul>';
  41      }
  42      foreach ($tips as $name => $tiplist) {
  43        if ($multiple) {
  44          $output .= '<li>';
  45          $output .= '<strong>'. $name .'</strong>:<br />';
  46        }
  47  
  48        if (count($tiplist) > 0) {
  49          $output .= '<ul class="tips">';
  50          foreach ($tiplist as $tip) {
  51            $output .= '<li'. ($long ? ' id="filter-'. str_replace("/", "-", $tip['id']) .'">' : '>') . $tip['tip'] .'</li>';
  52          }
  53          $output .= '</ul>';
  54        }
  55  
  56        if ($multiple) {
  57          $output .= '</li>';
  58        }
  59      }
  60      if ($multiple) {
  61        $output .= '</ul>';
  62      }
  63    }
  64  
  65    return $output;
  66  }


Generated: Thu Mar 24 11:18:33 2011 Cross-referenced by PHPXref 0.7