'. t('The filter module allows administrators to configure text input formats for the site. For example, an administrator may want a filter to strip out malicious HTML from user\'s comments. Administrators may also want to make URLs linkable even if they are only entered in an unlinked format.') .'

'; $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. Administrators can also create new input formats. Each input format can be configured to use a selection of filters.') .'

'; $output .= t('

You can

', array('%admin-filters' => url('admin/filters'))); $output .= '

'. t('For more information please read the configuration and customization handbook Filter page.', array('%filter' => 'http://drupal.org/handbook/modules/filter/')) .'

'; return $output; case 'admin/modules#description': return t('Handles the filtering of content in preparation for display.'); case 'admin/filters': return t('

Input formats define a way of processing user-supplied text in Drupal. Every input format has its own settings of which filters to apply. Possible filters include stripping out malicious HTML and making URLs clickable.

Users can choose between the available input formats when submitting content.

Below you can configure which input formats are available to which roles, as well as choose a default input format (used for imported content, for example).

Note that (1) the default format is always available to all roles, and (2) all filter formats can always be used by roles with the "administer filters" permission even if they are not explicitly listed in the Roles column of this table.

'); case 'admin/filters/'. arg(2): 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/filters/'. arg(2) .'/order'))); case 'admin/filters/'. arg(2) .'/configure': return t('

If you cannot find the settings for a certain filter, make sure you\'ve enabled it on the view tab first.

', array('%url' => url('admin/filters/'. arg(2)))); case 'admin/filters/'. arg(2) .'/order': return 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 in a clickable link. When this happens, you will need to rearrange the order in which filters get executed.

Filters are executed from top-to-bottom. You can use the weight column to rearrange them: heavier filters \'sink\' to the bottom.

'); } } /** * Implementation of hook_menu(). */ function filter_menu($may_cache) { $items = array(); if ($may_cache) { $items[] = array('path' => 'admin/filters', 'title' => t('input formats'), 'callback' => 'filter_admin_overview', 'access' => user_access('administer filters'), ); $items[] = array('path' => 'admin/filters/list', 'title' => t('list'), 'callback' => 'filter_admin_overview', 'type' => MENU_DEFAULT_LOCAL_TASK, 'access' => user_access('administer filters'), ); $items[] = array('path' => 'admin/filters/add', 'title' => t('add input format'), 'callback' => 'filter_admin_format_form', 'type' => MENU_LOCAL_TASK, 'weight' => 1, 'access' => user_access('administer filters'), ); $items[] = array('path' => 'admin/filters/delete', 'title' => t('delete input format'), 'callback' => 'filter_admin_delete', 'type' => MENU_CALLBACK, 'access' => user_access('administer filters'), ); $items[] = array('path' => 'filter/tips', 'title' => t('compose tips'), 'callback' => 'filter_tips_long', 'access' => TRUE, 'type' => MENU_SUGGESTED_ITEM, ); } else { if (arg(0) == 'admin' && arg(1) == 'filters' && is_numeric(arg(2))) { $formats = filter_formats(); if (isset($formats[arg(2)])) { $items[] = array('path' => 'admin/filters/'. arg(2), 'title' => t("'%format' input format", array('%format' => $formats[arg(2)]->name)), 'callback' => 'filter_admin_format_form', 'callback arguments' => array('format' => $formats[arg(2)]), 'type' => MENU_CALLBACK, 'access' => user_access('administer filters'), ); $items[] = array('path' => 'admin/filters/'. arg(2) .'/list', 'title' => t('view'), 'callback' => 'filter_admin_format_form', 'callback arguments' => array('format' => $formats[arg(2)]), 'type' => MENU_DEFAULT_LOCAL_TASK, 'weight' => 0, 'access' => user_access('administer filters'), ); $items[] = array('path' => 'admin/filters/'. arg(2) .'/configure', 'title' => t('configure'), 'callback' => 'filter_admin_configure', 'type' => MENU_LOCAL_TASK, 'weight' => 1, 'access' => user_access('administer filters'), ); $items[] = array('path' => 'admin/filters/'. arg(2) .'/order', 'title' => t('rearrange'), 'callback' => 'filter_admin_order', 'callback arguments' => array('format' => $formats[arg(2)]), 'type' => MENU_LOCAL_TASK, 'weight' => 2, 'access' => user_access('administer filters'), ); } } } return $items; } /** * Implementation of hook_perm(). */ function filter_perm() { return array('administer filters'); } /** * 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", '