_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/filter.admin.inc
Generate a text format form.
filter_tips_long in modules/filter/filter.pages.inc
Menu callback; show a page with long filter tips.
theme_filter_guidelines in modules/filter/filter.module
Format guidelines for a text format.

Code

modules/filter/filter.module, line 720

<?php
function _filter_tips($format_id, $long = FALSE) {
  global $user;

  $formats = filter_formats($user);
  $filter_info = filter_get_filters();

  $tips = array();

  // If only listing one format, extract it from the $formats array.
  if ($format_id != -1) {
    $formats = array($formats[$format_id]);
  }

  foreach ($formats as $format) {
    $filters = filter_list_format($format->format);
    $tips[$format->name] = array();
    foreach ($filters as $name => $filter) {
      if ($filter->status && isset($filter_info[$name]['tips callback']) && function_exists($filter_info[$name]['tips callback'])) {
        $tip = $filter_info[$name]['tips callback']($filter, $format, $long);
        $tips[$format->name][$name] = array('tip' => $tip, 'id' => $name);
      }
    }
  }

  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.