You are here

function theme_table_drag_components in Vertical Tabs Config 7

Rendering of draggable table.

1 theme call to theme_table_drag_components()
vertical_tabs_config_admin_settings_order in ./vertical_tabs_config.admin.inc
Order configuration form.

File

./vertical_tabs_config.module, line 263
Vertical tabs config main file.

Code

function theme_table_drag_components($vars) {
  $element = $vars['element'];
  drupal_add_tabledrag('vt_order_table', 'order', 'sibling', 'item-row-weight');
  $header = array(
    'label' => t('Vertical tab'),
    'weight' => t('Weight'),
  );
  $rows = array();
  foreach (element_children($element) as $key) {
    $row = array();
    $row['data'] = array();
    foreach ($header as $fieldname => $title) {
      $row['data'][] = drupal_render($element[$key][$fieldname]);
      $row['class'] = array(
        'draggable',
      );
    }
    $rows[] = $row;
  }
  return theme('table', array(
    'header' => $header,
    'rows' => $rows,
    'attributes' => array(
      'id' => 'vt_order_table',
    ),
  ));
}