_filter_tips

Versions
4.6 – 4.7
_filter_tips($format, $long = false)
5 – 6
_filter_tips($format, $long = FALSE)
7
_filter_tips($format_id, $long = FALSE)

Helper function for fetching filter tips.

▾ 3 functions call _filter_tips()

filter_admin_format_form in modules/filter.module
Generate a filter format form.
filter_form in modules/filter.module
Generate a selector for choosing a format in a form.
filter_tips_long in modules/filter.module
Menu callback; show a page with long filter tips.

Code

modules/filter.module, line 882

<?php
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;
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.