1 filter.theme.inc | theme_filter_admin_overview($variables) |
Returns HTML for the text format administration overview form.
Parameters
$variables: An associative array containing:
- form: A render element representing the form.
Related topics
File
- core/
modules/ filter/ filter.theme.inc, line 78 - Theme functions for the Filter module.
Code
function theme_filter_admin_overview($variables) {
$form = $variables['form'];
$rows = array();
$first_disabled_row = TRUE;
foreach (element_children($form['formats']) as $id) {
$form['formats'][$id]['weight']['#attributes']['class'] = array('text-format-order-weight');
$row = array(
'data' => array(
backdrop_render($form['formats'][$id]['name']),
backdrop_render($form['formats'][$id]['editor']),
backdrop_render($form['formats'][$id]['roles']),
backdrop_render($form['formats'][$id]['weight']),
backdrop_render($form['formats'][$id]['operations']),
),
);
if ($form['formats'][$id]['#status']) {
$row['class'] = array('draggable', 'enabled');
}
else {
// Add a heading above the first disabled row.
if ($first_disabled_row) {
$first_disabled_row = FALSE;
// Create a row that spans all columns.
$rows[] = array(
'data' => array(
array(
'data' => t('Disabled'),
'colspan' => 5,
'header' => TRUE,
),
),
);
}
$row['class'] = array('disabled');
}
$rows[] = $row;
}
$header = array(t('Name'), t('Editor'), t('Roles'), t('Weight'), t('Operations'));
$output = backdrop_render($form['help']);
$output .= theme('table', array('header' => $header, 'rows' => $rows, 'attributes' => array('id' => 'text-format-order')));
$output .= backdrop_render_children($form);
backdrop_add_tabledrag('text-format-order', 'order', 'sibling', 'text-format-order-weight');
return $output;
}