You are here

function theme_file_entity_file_display_order in File Entity (fieldable files) 7

Same name and namespace in other branches
  1. 7.3 file_entity.admin.inc \theme_file_entity_file_display_order()
  2. 7.2 file_entity.admin.inc \theme_file_entity_file_display_order()

Returns HTML for a file display's display order table.

1 theme call to theme_file_entity_file_display_order()
file_entity_file_display_form in ./file_entity.admin.inc
Form callback; presents file display settings for a given view mode.

File

./file_entity.admin.inc, line 325
Administrative interface for file type configuration.

Code

function theme_file_entity_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(
        drupal_render($element[$name]['label']),
        drupal_render($element[$name]['weight']),
      ),
      'class' => array(
        'draggable',
      ),
    );
  }
  $output = drupal_render_children($element);
  $output .= theme('table', array(
    'rows' => $rows,
    'attributes' => array(
      'id' => 'file-displays-order',
    ),
  ));
  drupal_add_tabledrag('file-displays-order', 'order', 'sibling', 'file-display-order-weight', NULL, NULL, TRUE);
  return $output;
}