You are here

function _filter_tips in Drupal 6

Same name and namespace in other branches
  1. 8 core/modules/filter/filter.module \_filter_tips()
  2. 4 modules/filter.module \_filter_tips()
  3. 5 modules/filter/filter.module \_filter_tips()
  4. 7 modules/filter/filter.module \_filter_tips()
  5. 9 core/modules/filter/filter.module \_filter_tips()
  6. 10 core/modules/filter/filter.module \_filter_tips()

Helper function for fetching filter tips.

3 calls to _filter_tips()
filter_admin_format_form in modules/filter/filter.admin.inc
Generate a filter format form.
filter_form in modules/filter/filter.module
Generates a selector for choosing a format in a form.
filter_tips_long in modules/filter/filter.pages.inc
Menu callback; show a page with long filter tips.

File

modules/filter/filter.module, line 570
Framework for handling filtering of content.

Code

function _filter_tips($format, $long = FALSE) {
  if ($format == -1) {
    $formats = filter_formats();
  }
  else {
    $formats = array(
      db_fetch_object(db_query("SELECT * FROM {filter_formats} WHERE format = %d", $format)),
    );
  }
  $tips = array();
  foreach ($formats as $format) {
    $filters = filter_list_format($format->format);
    $tips[$format->name] = array();
    foreach ($filters as $id => $filter) {
      if ($tip = module_invoke($filter->module, 'filter_tips', $filter->delta, $format->format, $long)) {
        $tips[$format->name][] = array(
          'tip' => $tip,
          'id' => $id,
        );
      }
    }
  }
  return $tips;
}