? 710908_styles_fields.patch
? sortable_layers.patch
? tests/plugins
Index: modules/openlayers_ui/openlayers_ui.css
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/openlayers/modules/openlayers_ui/Attic/openlayers_ui.css,v
retrieving revision 1.1.2.4
diff -u -p -r1.1.2.4 openlayers_ui.css
--- modules/openlayers_ui/openlayers_ui.css	18 May 2010 19:25:57 -0000	1.1.2.4
+++ modules/openlayers_ui/openlayers_ui.css	19 Jul 2010 14:00:10 -0000
@@ -78,6 +78,10 @@ div.openlayers-column-left ul#openlayers
     margin-right:-1px;
     }
 
+  div.handle {
+    cursor: move;
+  }
+
 /* Panels */
 div.openlayers-panel {
   border:1px solid #ccc;
Index: modules/openlayers_ui/includes/openlayers_ui.presets.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/openlayers/modules/openlayers_ui/includes/Attic/openlayers_ui.presets.inc,v
retrieving revision 1.1.2.26
diff -u -p -r1.1.2.26 openlayers_ui.presets.inc
--- modules/openlayers_ui/includes/openlayers_ui.presets.inc	18 Jul 2010 19:36:50 -0000	1.1.2.26
+++ modules/openlayers_ui/includes/openlayers_ui.presets.inc	19 Jul 2010 14:00:10 -0000
@@ -25,6 +25,9 @@ function openlayers_ui_presets_clone($pr
 function openlayers_ui_presets_form(&$form_state, $preset = NULL, $edit = FALSE) {
   openlayers_include();
   ctools_include('dependent');
+  if (module_exists('jquery_ui')) {
+    jquery_ui_add(array('ui.draggable', 'ui.droppable', 'ui.sortable'));
+  }
   drupal_add_js(drupal_get_path('module', 'openlayers_ui') . '/js/openlayers_ui.presets.js', 'module');
   drupal_add_css(drupal_get_path('module', 'openlayers_ui') . '/openlayers_ui.css');
 
Index: modules/openlayers_ui/includes/openlayers_ui.theme.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/openlayers/modules/openlayers_ui/includes/Attic/openlayers_ui.theme.inc,v
retrieving revision 1.1.2.8
diff -u -p -r1.1.2.8 openlayers_ui.theme.inc
--- modules/openlayers_ui/includes/openlayers_ui.theme.inc	22 Mar 2010 23:55:10 -0000	1.1.2.8
+++ modules/openlayers_ui/includes/openlayers_ui.theme.inc	19 Jul 2010 14:00:10 -0000
@@ -86,7 +86,9 @@ function theme_openlayers_ui_presets_for
     $row[] = drupal_render($form['layers']['default_layer'][$key]);
     $rows[] = $row;
   }
-  $output .= theme('table', array(t('Base layers'), t('Enabled'), t('Default')), $rows);
+  drupal_add_tabledrag('baselayer-layer-table', 'order', 'sibling', 'block-weight', NULL, NULL, FALSE);
+  $output .= theme('table', array(t('Base layers'), t('Enabled'), t('Default')), $rows,
+    array('id' => 'baselayer-layer-table'));
 
   // Overlay layers
   $rows = array();
@@ -103,7 +105,8 @@ function theme_openlayers_ui_presets_for
     $row[] = drupal_render($form['layer_styles'][$key]);
     $rows[] = $row;
   }
-  $output .= theme('table', array(t('Overlay layers'), t('Enabled'), t('Activated'), t('In Switcher'), t('Style')), $rows);
+  drupal_add_tabledrag('overlay-layer-table', 'order', 'sibling', 'layer-weight', NULL, NULL, FALSE);
+  $output .= theme('table', array(t('Overlay layers'), t('Enabled'), t('Activated'), t('In Switcher'), t('Style')), $rows, array('id' => 'overlay-layer-table'));
   $output .= drupal_render($form);
   return $output;
 }
Index: modules/openlayers_ui/js/openlayers_ui.presets.js
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/openlayers/modules/openlayers_ui/js/Attic/openlayers_ui.presets.js,v
retrieving revision 1.1.2.3
diff -u -p -r1.1.2.3 openlayers_ui.presets.js
--- modules/openlayers_ui/js/openlayers_ui.presets.js	28 May 2010 15:37:30 -0000	1.1.2.3
+++ modules/openlayers_ui/js/openlayers_ui.presets.js	19 Jul 2010 14:00:10 -0000
@@ -85,6 +85,19 @@ Drupal.behaviors.openlayers_ui = functio
     }
   });
 
+  // make base and overlay layers sortable if jquery_ui is present
+  if ($.ui.sortable !== null) {
+    var params = {
+      revert: true,
+      dropOnEmpty: true,
+      placeholder: 'draggable-placeholder',
+      forcePlaceholderSize: true,
+      items: 'tr',
+      handle: 'div.handle'
+    };
+    $('#baselayer-layer-table, #overlay-layer-table').sortable(params);
+  }
+
   // Run once on load.
   Drupal.openlayers_ui.updateMapCenter();
 }
