'. t("The filter module allows administrators to configure text input formats for use on your site. An input format defines the HTML tags, codes, and other input allowed in both content and comments, and is a key feature in guarding against potentially damaging input from malicious users. Two input formats included by default are Filtered HTML (which allows only an administrator-approved subset of HTML tags) and Full HTML (which allows the full set of HTML tags). Additional input formats may be created by an administrator.") .'

'; $output .= '

'. t('Each input format uses filters to manipulate text, and most input formats apply several different filters to text in a specific order. Each filter is designed for a specific purpose, and generally either adds, removes or transforms elements within user-entered text before it is displayed. A filter does not change the actual content of a post, but instead, modifies it temporarily before it is displayed. A filter may remove unapproved HTML tags, for instance, while another automatically adds HTML to make links referenced in text clickable.') .'

'; $output .= '

'. t('Users can choose between the available input formats when creating or editing content. Administrators can configure which input formats are available to which user roles, as well as choose a default input format.') .'

'; $output .= '

'. t('For more information, see the online handbook entry for Filter module.', array('@filter' => 'http://drupal.org/handbook/modules/filter/')) .'

'; return $output; case 'admin/settings/filters': $output = '

'. t('Input formats define a way of processing user-supplied text in Drupal. Each input format uses filters to manipulate text, and most input formats apply several different filters to text, in a specific order. Each filter is designed to accomplish a specific purpose, and generally either removes elements from or adds elements to text before it is displayed. Users can choose between the available input formats when submitting content.') .'

'; $output .= '

'. t('Use the list below to configure which input formats are available to which roles, as well as choose a default input format (used for imported content, for example). The default format is always available to users. All input formats are available to users in a role with the "administer filters" permission.') .'

'; return $output; case 'admin/settings/filters/%': return '

'. t('Every filter performs one particular change on the user input, for example stripping out malicious HTML or making URLs clickable. Choose which filters you want to apply to text in this input format. If you notice some filters are causing conflicts in the output, you can rearrange them.', array('@rearrange' => url('admin/settings/filters/'. $arg[3] .'/order'))) .'

'; case 'admin/settings/filters/%/configure': return '

'. t('If you cannot find the settings for a certain filter, make sure you have enabled it on the view tab first.', array('@url' => url('admin/settings/filters/'. $arg[3]))) .'

'; case 'admin/settings/filters/%/order': $output = '

'. t('Because of the flexible filtering system, you might encounter a situation where one filter prevents another from doing its job. For example: a word in an URL gets converted into a glossary term, before the URL can be converted to a clickable link. When this happens, rearrange the order of the filters.') .'

'; $output .= '

'. t("Filters are executed from top-to-bottom. To change the order of the filters, modify the values in the Weight column or grab a drag-and-drop handle under the Name column and drag filters to new locations in the list. (Grab a handle by clicking and holding the mouse while hovering over a handle icon.) Remember that your changes will not be saved until you click the Save configuration button at the bottom of the page.") .'

'; return $output; } } /** * Implementation of hook_theme() */ function filter_theme() { return array( 'filter_admin_overview' => array( 'arguments' => array('form' => NULL), 'file' => 'filter.admin.inc', ), 'filter_admin_order' => array( 'arguments' => array('form' => NULL), 'file' => 'filter.admin.inc', ), 'filter_tips' => array( 'arguments' => array('tips' => NULL, 'long' => FALSE, 'extra' => ''), 'file' => 'filter.pages.inc', ), 'filter_tips_more_info' => array( 'arguments' => array(), ), ); } /** * Implementation of hook_menu(). */ function filter_menu() { $items['admin/settings/filters'] = array( 'title' => 'Input formats', 'description' => 'Configure how content input by users is filtered, including allowed HTML tags. Also allows enabling of module-provided filters.', 'page callback' => 'drupal_get_form', 'page arguments' => array('filter_admin_overview'), 'access arguments' => array('administer filters'), 'file' => 'filter.admin.inc', ); $items['admin/settings/filters/list'] = array( 'title' => 'List', 'type' => MENU_DEFAULT_LOCAL_TASK, ); $items['admin/settings/filters/add'] = array( 'title' => 'Add input format', 'page callback' => 'filter_admin_format_page', 'access arguments' => array('administer filters'), 'type' => MENU_LOCAL_TASK, 'weight' => 1, 'file' => 'filter.admin.inc', ); $items['admin/settings/filters/delete'] = array( 'title' => 'Delete input format', 'page callback' => 'drupal_get_form', 'page arguments' => array('filter_admin_delete'), 'access arguments' => array('administer filters'), 'type' => MENU_CALLBACK, 'file' => 'filter.admin.inc', ); $items['filter/tips'] = array( 'title' => 'Compose tips', 'page callback' => 'filter_tips_long', 'access callback' => TRUE, 'type' => MENU_SUGGESTED_ITEM, 'file' => 'filter.pages.inc', ); $items['admin/settings/filters/%filter_format'] = array( 'type' => MENU_CALLBACK, 'title callback' => 'filter_admin_format_title', 'title arguments' => array(3), 'page callback' => 'filter_admin_format_page', 'page arguments' => array(3), 'access arguments' => array('administer filters'), 'file' => 'filter.admin.inc', ); $items['admin/settings/filters/%filter_format/edit'] = array( 'title' => 'Edit', 'type' => MENU_DEFAULT_LOCAL_TASK, 'weight' => 0, 'file' => 'filter.admin.inc', ); $items['admin/settings/filters/%filter_format/configure'] = array( 'title' => 'Configure', 'page callback' => 'filter_admin_configure_page', 'page arguments' => array(3), 'access arguments' => array('administer filters'), 'type' => MENU_LOCAL_TASK, 'weight' => 1, 'file' => 'filter.admin.inc', ); $items['admin/settings/filters/%filter_format/order'] = array( 'title' => 'Rearrange', 'page callback' => 'filter_admin_order_page', 'page arguments' => array(3), 'access arguments' => array('administer filters'), 'type' => MENU_LOCAL_TASK, 'weight' => 2, 'file' => 'filter.admin.inc', ); return $items; } function filter_format_load($arg) { return filter_formats($arg); } /** * Display a filter format form title. */ function filter_admin_format_title($format) { return $format->name; } /** * Implementation of hook_perm(). */ function filter_perm() { return array('administer filters'); } /** * Implementation of hook_cron(). * * Expire outdated filter cache entries */ function filter_cron() { cache_clear_all(NULL, 'cache_filter'); } /** * Implementation of hook_filter_tips(). */ function filter_filter_tips($delta, $format, $long = FALSE) { global $base_url; switch ($delta) { case 0: if (variable_get("filter_html_$format", FILTER_HTML_STRIP) == FILTER_HTML_STRIP) { if ($allowed_html = variable_get("allowed_html_$format", '