function filter_admin_overview
Same name and namespace in other branches
- 7.x drupal-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
2 string references to 'filter_admin_overview'
- filter_menu in drupal-6.x/
modules/ filter/ filter.module - Implementation of hook_menu().
- filter_theme in drupal-6.x/
modules/ filter/ filter.module - Implementation of hook_theme()
Archivo
- drupal-6.x/
modules/ filter/ filter.admin.inc, line 15 - Admin page callbacks for the filter module.
Código
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;
}