, and * replace it by the current time. */ /** * Implements hook_menu(). */ function filter_example_menu() { $items['examples/filter_example'] = array( 'title' => 'Filter Example', 'page callback' => '_filter_example_information', 'access callback' => TRUE, ); return $items; } /** * Implements hook_filter_info(). * * Here we define the diferent filters provided by the module. For this example, * time_filter is a very static and simple replacement, but it requires some * preparation of the string because of the special html tags < and >. The * foo_filter is more complex, including its own settings and inline tips. */ function filter_example_filter_info() { $filters['filter_foo'] = array( 'title' => t('Foo filter'), 'description' => t('Every instance of "foo" in the input text will be replaced with a preconfigured replacement.'), 'process callback' => '_filter_example_filter_foo_process', 'default settings' => array( 'filter_example_foo' => 'bar', ), 'settings callback' => '_filter_example_filter_foo_settings', 'tips callback' => '_filter_example_filter_foo_tips', ); $filters['filter_time'] = array( 'title' => t('Time tag'), 'description' => t('Every instance of the special <time /> tag will be replaced with the current date and time in the user\'s specified time zone.'), 'prepare callback' => '_filter_example_filter_time_prepare', 'process callback' => '_filter_example_filter_time_process', 'tips callback' => '_filter_example_filter_time_tips', ); return $filters; } /* * Foo filter * * Drupal has several content formats (they are not filters), and in our example * the foo replacement can be configured for each one of them, allowing an html * or php replacement, so the module includes a settings callback, with options * to configure that replacements. Also, a Tips callback will help showing the * current replacement for the content type being edited. */ /** * Simply returns a little bit of information about the example. */ function _filter_example_information() { return t( "There are two filters in this example. The first (foo filter) just replaces 'foo' with a configurable replacement. The second replaces the string '