filter_admin_overview()
drupal/modules/filter/filter.admin.inc, line 15
Menu callback; Displays a list of all input formats and which one is the default.
@see filter_admin_overview_submit()
| Name | Description |
|---|---|
| Form builder functions | Functions that build an abstract representation of a HTML form. |
function filter_admin_overview() {
// Overview of all formats.
$formats = filter_formats();
$error = FALSE;
$form = array('#tree' => TRUE);
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[$id]['name'] = array('#markup' => $format->name);
$form[$id]['roles'] = array('#markup' => $default ? t('All roles may use default format') : ($roles ? implode(', ', $roles) : t('No roles may use this format')));
$form[$id]['configure'] = array('#markup' => l(t('configure'), 'admin/settings/filters/' . $id));
$form[$id]['delete'] = array('#markup' => $default ? '' : l(t('delete'), 'admin/settings/filters/delete/' . $id));
$form[$id]['weight'] = array('#type' => 'weight', '#default_value' => $format->weight);
}
$form['default'] = array('#type' => 'radios', '#options' => $options, '#default_value' => variable_get('filter_default_format', 1));
$form['submit'] = array('#type' => 'submit', '#value' => t('Save changes'));
return $form;
}