Same name and namespace in other branches
  1. 4.6.x modules/filter.module \filter_admin_overview()
  2. 4.7.x modules/filter.module \filter_admin_overview()
  3. 5.x modules/filter/filter.module \filter_admin_overview()
  4. 7.x modules/filter/filter.admin.inc \filter_admin_overview()

Menu callback; Displays a list of all input formats and which one is the default.

See also

filter_admin_overview_submit()

Related topics

1 string reference to 'filter_admin_overview'
filter_menu in modules/filter/filter.module
Implementation of hook_menu().

File

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

Code

function filter_admin_overview() {

  // Overview of all formats.
  $formats = filter_formats();
  $error = FALSE;
  foreach ($formats as $id => $format) {
    $roles = array();
    foreach (user_roles() as $rid => $name) {

      // Prepare a roles array with roles that may access the filter.
      if (strstr($format->roles, ",{$rid},")) {
        $roles[] = $name;
      }
    }
    $default = $id == variable_get('filter_default_format', 1);
    $options[$id] = '';
    $form[$format->name]['id'] = array(
      '#value' => $id,
    );
    $form[$format->name]['roles'] = array(
      '#value' => $default ? t('All roles may use default format') : ($roles ? implode(', ', $roles) : t('No roles may use this format')),
    );
    $form[$format->name]['configure'] = array(
      '#value' => l(t('configure'), 'admin/settings/filters/' . $id),
    );
    $form[$format->name]['delete'] = array(
      '#value' => $default ? '' : l(t('delete'), 'admin/settings/filters/delete/' . $id),
    );
  }
  $form['default'] = array(
    '#type' => 'radios',
    '#options' => $options,
    '#default_value' => variable_get('filter_default_format', 1),
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Set default format'),
  );
  return $form;
}