You are here

function theme_salesforce_mapping_overview_tabledrag_form in Salesforce Suite 7.3

Returns the rendered tabledrag form for the entity overview listing.

1 theme call to theme_salesforce_mapping_overview_tabledrag_form()
SalesforceMappingUIController::overviewForm in modules/salesforce_mapping/includes/salesforce_mapping.ui_controller.inc
Overrides EntityDefaultUIController::overviewForm().

File

modules/salesforce_mapping/includes/salesforce_mapping.ui_controller.inc, line 120
Contains SalesforceMappingUIController.

Code

function theme_salesforce_mapping_overview_tabledrag_form($variables) {
  drupal_add_tabledrag('entity-ui-overview-form', 'order', 'sibling', 'entity-ui-weight');
  $form = $variables['form'];
  $rows = array();
  foreach (element_children($form) as $key) {
    $form[$key]['weight']['#attributes']['class'] = array(
      'entity-ui-weight',
    );
    $row = $form[$key]['#row'];

    // Replace the weight   column with the dropdown.
    $row['weight'] = array(
      'data' => $form[$key]['weight'],
    );
    $rows[$key] = array(
      'data' => $row,
      'class' => array(
        'draggable',
      ),
    );
  }
  $render = array(
    '#theme' => 'table',
    '#header' => $form['#header'],
    '#rows' => $rows,
    '#empty' => t('None.'),
    '#attributes' => array(
      'id' => 'entity-ui-overview-form',
    ),
  );
  return drupal_render($render);
}