1 file.theme.inc | theme_file_display_order($variables) |
Returns HTML for a file display's display order table.
File
- core/
modules/ file/ file.theme.inc, line 361 - Theme functions for the File module.
Code
function theme_file_display_order($variables) {
$element = $variables['element'];
$rows = array();
foreach (element_children($element, TRUE) as $name) {
$element[$name]['weight']['#attributes']['class'][] = 'file-display-order-weight';
$rows[] = array(
'data' => array(
backdrop_render($element[$name]['label']),
backdrop_render($element[$name]['weight']),
),
'class' => array('draggable'),
);
}
$output = backdrop_render_children($element);
$output .= theme('table', array('rows' => $rows, 'attributes' => array('id' => 'file-displays-order')));
backdrop_add_tabledrag('file-displays-order', 'order', 'sibling', 'file-display-order-weight', NULL, NULL, TRUE);
return $output;
}