You are here

function filter_admin_configure in Drupal 6

Same name and namespace in other branches
  1. 4 modules/filter.module \filter_admin_configure()
  2. 5 modules/filter/filter.module \filter_admin_configure()

Build a form to change the settings for a format's filters.

Related topics

1 string reference to 'filter_admin_configure'
filter_admin_configure_page in modules/filter/filter.admin.inc
Menu callback; display settings defined by a format's filters.

File

modules/filter/filter.admin.inc, line 297
Admin page callbacks for the filter module.

Code

function filter_admin_configure(&$form_state, $format) {
  $list = filter_list_format($format->format);
  $form = array();
  foreach ($list as $filter) {
    $form_module = module_invoke($filter->module, 'filter', 'settings', $filter->delta, $format->format);
    if (isset($form_module) && is_array($form_module)) {
      $form = array_merge($form, $form_module);
    }
  }
  if (!empty($form)) {
    $form = system_settings_form($form);
  }
  else {
    $form['error'] = array(
      '#value' => t('No settings are available.'),
    );
  }
  $form['format'] = array(
    '#type' => 'hidden',
    '#value' => $format->format,
  );
  $form['#submit'][] = 'filter_admin_configure_submit';
  return $form;
}