You are here

function theme_easy_social_admin_order in Easy Social 7.2

Theme callback. Implements draggable table in Easy Social sort form.

See also

easy_social_admin_order()

easy_social_theme()

File

includes/easy_social.admin.inc, line 628
Easy Social admin settings.

Code

function theme_easy_social_admin_order($variables) {
  $output = '';
  $form = $variables['form'];
  $header = array(
    'Title',
    'Weight',
  );
  $table_id = 'easy_social_widget_order';
  foreach (element_children($form['widgets']) as $id) {
    $data = array();
    $data[] = $form['widgets'][$id]['#widget'];
    $data[] = drupal_render($form['widgets'][$id]['weight']);
    $rows[] = array(
      'data' => $data,
      'class' => array(
        'draggable',
      ),
    );
  }
  drupal_add_tabledrag($table_id, 'order', 'sibling', 'weight_group');
  $output .= theme('table', array(
    'header' => $header,
    'rows' => $rows,
    'attributes' => array(
      'id' => $table_id,
    ),
  ));
  $output .= drupal_render_children($form);
  return $output;
}