diff --git a/core/modules/image/image.admin.inc b/core/modules/image/image.admin.inc index b8f9c96..fb59c4b 100644 --- a/core/modules/image/image.admin.inc +++ b/core/modules/image/image.admin.inc @@ -16,50 +16,56 @@ */ function theme_image_style_effects($variables) { $form = $variables['form']; - $rows = array(); + + $table = array( + '#type' => 'table', + '#header' => array( + t('Effect'), + t('Weight'), + t('Operations'), + ), + '#tabledrag' => array( + array('order', 'sibling', 'image-effect-order-weight'), + ), + '#attributes' => array( + 'id' => 'image-style-effects' + ), + '#empty' => t('There are currently no effects in this style. Add one by selecting an option below.'), + ); + + $row_defaults = array( + '#attributes' => array( + 'class' => array('draggable'), + ) + ); foreach (element_children($form) as $key) { - $row = array(); $form[$key]['weight']['#attributes']['class'] = array('image-effect-order-weight'); if ($key != 'new') { $summary = drupal_render($form[$key]['summary']); - $row[] = drupal_render($form[$key]['label']) . (empty($summary) ? '' : ' ' . $summary); - $row[] = drupal_render($form[$key]['weight']); - $row[] = array('data' => $form[$key]['operations']); + + $table[$key] = $row_defaults + array( + 'label_summary' => array( + '#markup' => drupal_render($form[$key]['label']) . (empty($summary) ? '' : ' ' . $summary), + ), + 'weight' => $form[$key]['weight'], + 'operations' => $form[$key]['operations'], + ); } else { // Add the row for adding a new image effect. - $row[] = '