You are here

function theme_socialfield_form_table in Social field 7

Theme callback for the form table.

1 theme call to theme_socialfield_form_table()
_socialfield_field_instance_settings_form in ./socialfield.module
Instance settings form process callback function.

File

./socialfield.module, line 470
Provides a field for adding social services links.

Code

function theme_socialfield_form_table(&$variables) {

  // Getting the userful values.
  $form = $variables['form'];
  $data = $form['rows'];
  $header = $form['#header'];
  $attributes = $form['#attributes'];

  // Traverse each row and each column in each row.
  $rows = array();
  foreach (element_children($data) as $row_index) {
    $row = array();
    foreach (element_children($data[$row_index]) as $col_index) {
      $element = $data[$row_index][$col_index];
      if (isset($element['#type']) && $element['#type'] == 'hidden') {
        continue;
      }
      $row[] = drupal_render($data[$row_index][$col_index]);
    }
    $rows[] = array(
      'data' => $row,
      'class' => array(
        'draggable',
      ),
    );
  }
  $output = theme('table', array(
    'header' => $header,
    'rows' => $rows,
    'attributes' => $attributes,
  ));
  drupal_add_tabledrag($attributes['id'], 'order', 'sibling', 'services-order-weight');
  return $output;
}