Menu callback; configure the filters for a format.

File

modules/filter.module, line 403
Framework for handling filtering of content.

Code

function filter_admin_filters() {
  $format = arg(2);

  // Handle saving of weights.
  if ($_POST['op']) {
    filter_admin_filters_save($format, $_POST['edit']);
  }
  $all = filter_list_all();
  $enabled = filter_list_format($format);

  // Table with filters
  $header = array(
    t('Enabled'),
    t('Name'),
    t('Description'),
  );
  $rows = array();
  foreach ($all as $id => $filter) {
    $row = array();
    $row[] = form_checkbox('', $id, 1, isset($enabled[$id]));
    $row[] = $filter->name;
    $row[] = module_invoke($filter->module, 'filter', 'description', $filter->delta);
    $rows[] = $row;
  }
  $form = theme('table', $header, $rows);
  if (!$empty) {
    $form .= form_submit(t('Save configuration'));
  }
  $output .= '<h2>' . t('Filters') . '</h2>' . form($form);

  // Composition tips (guidelines)
  $tips = _filter_tips($format, false);
  $extra = l(t('More information about formatting options'), 'filter/tips');
  $tiplist = theme('filter_tips', $tips, false, $extra);
  if (!$tiplist) {
    $tiplist = t('<p>No guidelines available.</p>');
  }
  $group = t('<p>These are the guidelines that users will see for posting in this input format. They are automatically generated from the filter settings.</p>');
  $group .= $tiplist;
  $output .= '<h2>' . t('Formatting guidelines') . '</h2>' . $group;
  print theme('page', $output);
}