5 * Test module for Filter module hooks and functions not used in core.
9 * Implements hook_filter_format_insert().
11 function filter_test_filter_format_insert($format) {
12 drupal_set_message('hook_filter_format_insert invoked.');
16 * Implements hook_filter_format_update().
18 function filter_test_filter_format_update($format) {
19 drupal_set_message('hook_filter_format_update invoked.');
23 * Implements hook_filter_format_disable().
25 function filter_test_filter_format_disable($format) {
26 drupal_set_message('hook_filter_format_disable invoked.');
30 * Implements hook_filter_info().
32 function filter_test_filter_info() {
33 $filters['filter_test_uncacheable'] = array(
34 'title' => 'Uncacheable filter',
35 'description' => 'Does nothing, but makes a text format uncacheable.',
38 $filters['filter_test_replace'] = array(
39 'title' => 'Testing filter',
40 'description' => 'Replaces all content with filter and text format information.',
41 'process callback' => 'filter_test_replace',
47 * Implements callback_filter_process().
49 * Process handler for filter_test_replace filter.
51 * Replaces all text with filter and text format information.
53 function filter_test_replace($text, $filter, $format, $langcode, $cache, $cache_id) {
55 $text[] = 'Filter: ' . $filter->title . ' (' . $filter->name . ')';
56 $text[] = 'Format: ' . $format->name . ' (' . $format->format . ')';
57 $text[] = 'Language: ' . $langcode;
58 $text[] = 'Cache: ' . ($cache ? 'Enabled' : 'Disabled');
60 $text[] = 'Cache ID: ' . $cache_id;
62 return implode("<br />\n", $text);