? drupal_drag_and_drop.patch Index: includes/common.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/common.inc,v retrieving revision 1.704 diff -u -p -r1.704 common.inc --- includes/common.inc 19 Oct 2007 10:30:54 -0000 1.704 +++ includes/common.inc 24 Oct 2007 04:07:44 -0000 @@ -1915,6 +1915,26 @@ function drupal_get_js($scope = 'header' return $output; } +function drupal_add_tabledrag($table_id, $group, $action, $relationship, $target, $source = NULL, $hidden = TRUE) { + static $js_added = FALSE; + if (!$js_added) { + drupal_add_js('misc/tabledrag.js', 'core'); + $js_added = TRUE; + } + + // If source isn't set, assume it is the same as the target. + $source = isset($source) ? $source : $target; + $settings['tabledrag'][$table_id][] = array( + 'target' => $target, + 'source' => $source, + 'relationship' => $relationship, + 'action' => $action, + 'group' => $group, + 'hidden' => $hidden, + ); + drupal_add_js($settings, 'setting'); +} + /** * Aggregate JS files, putting them in the files directory. * Index: misc/draggable.png =================================================================== RCS file: misc/draggable.png diff -N misc/draggable.png Binary files /dev/null and draggable.png differ Index: misc/tabledrag.js =================================================================== RCS file: misc/tabledrag.js diff -N misc/tabledrag.js --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ misc/tabledrag.js 24 Oct 2007 04:07:44 -0000 @@ -0,0 +1,347 @@ +// $Id $ + +Drupal.behaviors.tableDrag = function(context) { + for (var base in Drupal.settings.tabledrag) { + if (!$('#' + base + '.tabledrag-processed').size(), context) { + var fieldSettings = Drupal.settings.tabledrag[base]; + + $('#' + base + ':not(.tabledrag-processed)').each(function() { + // Create the new tabledrag instance. Save in the Drupal variable + // to allow other scripts access to the object. + Drupal.tabledrag[base] = new Drupal.tabledrag(fieldSettings); + Drupal.tabledrag[base].init(this); + }); + + $('#' + base).addClass('tabledrag-processed'); + } + } +} + +Drupal.tabledrag = function(fieldSettings) { + this.fieldSettings = fieldSettings; + this.dragObject = null; // Keep hold of the current drag object if any. + this.mouseOffset = null; // The current mouse offset. + this.table = null; // The current table. + this.oldY = 0; // Remember the old value of Y so that we don't do too much processing. +} + +// Initialize the drag and drop by capturing mouse move events. +Drupal.tabledrag.prototype.init = function(table) { + var self = this; + this.table = table; + // Make each applicable row draggable. + $('tr.draggable', table).each(function() { self.makeDraggable(this); }); + // Hide columns containing affected form elements. + this.hideColumns(); + // Now make the onmousemove method in the context of "self" so that we can get back to tableDnD + $(document).bind('mousemove', { tabledrag: self }, self.dragRow); + $(document).bind('mouseup', { tabledrag: self }, self.dropRow); +} + +/** + * Hide the columns containing form elements according to the settings for + * this tabledrag instance. + */ +Drupal.tabledrag.prototype.hideColumns = function() { + for (delta in this.fieldSettings) { + var hidden = this.fieldSettings[delta]['hidden']; + var field = $('.' + this.fieldSettings[delta]['target'] + ':first', this.table); + var cell = field.parents('td:first, th:first'); + if (hidden && cell[0] && cell.css('display') != 'none') { + var columnIndex = $('td, th', field.parents('tr:first')).index(cell.get(0)); + columnIndex++; // nth-child selector is 1 based, not 0 based. + $('tr', this.table).each(function() { + // Find and hide the cell in the table body. + var cell = $('td:nth-child('+ columnIndex +')', this); + if (cell.size()) { + cell.css('display', 'none'); + } + // We might be dealing with a row spanning the entire table. + // Reduce the colspan on the first cell to prevent the cell from + // overshooting the table. + else { + cell = $('td:first', this); + cell.attr('colspan', cell.attr('colspan') - 1); + } + // Remove table header cells entirely (Safari doesn't hide properly). + var th = $('th:nth-child('+ columnIndex +')', this); + if (th.size()) { + th.remove(); + } + }); + } + } +} + +/** + * Take an item and add an onmousedown method so that we can make it draggable. + */ +Drupal.tabledrag.prototype.makeDraggable = function(item) { + if (!item) return; + var self = this; // Keep the context of the tabledrag object. + // Add the handle. + handle = $('
 
'); + $('td:first', item).prepend(handle); + // Add hover action for the handle. + handle.hover(function() { + self.dragObject == null ? $(this).addClass('tabledrag-handle-hover') : null; + }, function() { + self.dragObject == null ? $(this).removeClass('tabledrag-handle-hover') : null; + }); + // Add the mousedown action for the handle. + handle.mousedown(function(event) { + self.dragObject = item; + self.mouseOffset = self.getMouseOffset(item, event); + $(this).addClass('tabledrag-handle-hover'); + // Update the style to show we're dragging. + $(this).parents('tr:first').addClass('highlight'); + return false; + }); +} + +/** + * Mousemove event handler, bound to document. + */ +Drupal.tabledrag.prototype.dragRow = function(event) { + var self = event.data.tabledrag; + if (self.dragObject) { + var mousePos = self.mouseCoords(event); + var y = mousePos.y - self.mouseOffset.y; + if (y != self.oldY) { + // Work out if we're going up or down... + var movingDown = y > self.oldY; + // Update the old value. + self.oldY = y; + // Check if we need to move any rows. + var currentRow = self.findDropTargetRow(y); + if (currentRow && self.dragObject != currentRow) { + if (movingDown) { + $(currentRow).after(self.dragObject); + } + else if (!movingDown) { + $(currentRow).before(self.dragObject); + } + self.restripeTable(self.table); + } + } + + return false; + } +}; + +/** + * Mouseup event handler, bound to document. + */ +Drupal.tabledrag.prototype.dropRow = function(event) { + var self = event.data.tabledrag; + if (self.dragObject != null) { + var droppedRow = self.dragObject; + // The row is already in the right place so we just release it. + $(droppedRow).removeClass('highlight'); + $('.tabledrag-handle', droppedRow).removeClass('tabledrag-handle-hover'); + self.updateFields(droppedRow); + self.markChanged(droppedRow); + self.dragObject = null; + self.onDrop(droppedRow); + } +}; + +/** + * Stub function. Allows custom javascript to add a handler when the row is + * dropped. + */ +Drupal.tabledrag.prototype.onDrop = function(droppedRow) { + return null; +} + +/** + * Get the position of an element by going up the DOM tree and adding up all + * the offsets. + */ +Drupal.tabledrag.prototype.getPosition = function(event){ + var left = 0; + var top = 0; + // Safari fix -- thanks to Luis Chato for this! + if (event.offsetHeight == 0) { + /* Safari 2 doesn't correctly grab the offsetTop of a table row + this is detailed here: + http://jacob.peargrove.com/blog/2006/technical/table-row-offsettop-bug-in-safari/ + the solution is likewise noted there, grab the offset of a table cell + in the row - the firstChild. note that firefox will return a text node + as a first child, so designing a more thorough solution may need to + take that into account, this seems to work in Firefox, Safari, and IE. + */ + event = event.firstChild; // a table cell + } + + while (event.offsetParent){ + left += event.offsetLeft; + top += event.offsetTop; + event = event.offsetParent; + } + + left += event.offsetLeft; + top += event.offsetTop; + + return {x:left, y:top}; +} + +/** + * Get the mouse coordinates from the event (allowing for browser differences). + */ +Drupal.tabledrag.prototype.mouseCoords = function(event){ + if (event.pageX || event.pageY) { + return {x:event.pageX, y:event.pageY}; + } + return { + x:event.clientX + document.body.scrollLeft - document.body.clientLeft, + y:event.clientY + document.body.scrollTop - document.body.clientTop + }; +} + +/** + * Given a target element and a mouse event, get the mouse offset from that + * element. To do this we need the element's position and the mouse position. + */ +Drupal.tabledrag.prototype.getMouseOffset = function(target, event){ + event = event || window.event; + + var docPos = this.getPosition(target); + var mousePos = this.mouseCoords(event); + return {x:mousePos.x - docPos.x, y:mousePos.y - docPos.y}; +} + +/** + * Find the row the mouse is currently over. This row is then taken and swapped + * with the one being dragged. + */ +Drupal.tabledrag.prototype.findDropTargetRow = function(y) { + var rows = this.table.tBodies[0].rows; + for (var n=0; n (rowY - rowHeight)) && (y < (rowY + rowHeight))) { + // We've found the row the mouse just passed over, but it doesn't take + // into account hidden rows. Skip backwards until we find a draggable + // row. + while ($(row).is(':not(.draggable)') && $(row).prev().is(':not(.draggable)')) { + row = $(row).prev().get(0); + } + // Special case for the first row, if it's not draggable, do not allow + // another row to be put before it. + if (!(n == 0 && $(row).is(':not(.draggable)'))) { + return row; + } + } + }; + return null; +} + +/** + * After the row is dropped, update the fields inside of it according to the + * dragtable settings. + */ +Drupal.tabledrag.prototype.updateFields = function(changedRow) { + // Because we may have moved the row from one category to another, + // take a look at our sibling and borrow it's sources and targets. + var previousRow = $(changedRow).prev('.draggable').get(0); + var nextRow = $(changedRow).next('.draggable').get(0); + var sourceRow = previousRow || nextRow; // Check neighbors. + sourceRow = sourceRow || changedRow; // Use self if alone. + this.copyDragClasses(sourceRow, changedRow); + + for (delta in this.fieldSettings) { + var targetClass = '.' + this.fieldSettings[delta]['target']; + var targetElement = $(targetClass, changedRow).get(0); + // Check if a target element exists in this row. + if (targetElement) { + var relationship = this.fieldSettings[delta]['relationship']; + var action = this.fieldSettings[delta]['action']; + var sourceClass = '.' + this.fieldSettings[delta]['source']; + var sourceElement = $(sourceClass, sourceRow).get(0); + + switch (action) { + case 'match': + // Update the value. + targetElement.value = sourceElement.value; + break; + case 'order': + if ($(targetElement).is('select')) { + // Get a list of acceptable values. + var values = new Array(); + $('option', targetElement).each(function() { + values.push(this.value); + }); + $(targetClass, this.table).each(function() { + this.value = values.shift(); + }); + } + else { + // Assume a numeric input field. + var weight = 0; + $(targetClass, this.table).each(function() { + this.value = weight; + weight++; + }); + } + break; + } + } + } +} + +/** + * Copy all special tabledrag classes from one row's form elements to a + * different one, removing any special classes that the destination row + * may have had. + */ +Drupal.tabledrag.prototype.copyDragClasses = function(sourceRow, destinationRow) { + for (d1 in this.fieldSettings) { + var originalClass = this.fieldSettings[d1]['target']; + var originalGroup = this.fieldSettings[d1]['group']; + for (d2 in this.fieldSettings) { + var updateClass = this.fieldSettings[d2]['target']; + var updateGroup = this.fieldSettings[d2]['group']; + if (originalGroup == updateGroup && $('.' + originalClass, destinationRow).length && $('.' + updateClass, sourceRow).length) { + $('.' + originalClass, destinationRow).removeClass(originalClass).addClass(updateClass); + } + } + } +} + +/** + * Add an asterisk or other marker to the changed row. + */ +Drupal.tabledrag.prototype.markChanged = function(changedRow) { + var marker = $('
' + Drupal.theme('tabledragChangedMarker') + '
'); + var cell = $('td:first', changedRow); + // Converting marker to a DOM object and using .html() to do string + // comparision ensures consitency across browsers. + if (cell.html().indexOf(marker.html()) == -1) { + cell.append(marker.html()); + } +} + +Drupal.tabledrag.prototype.restripeTable = function(table) { + // :even and :odd are reversed because jquery counts from 0 and + // we count from 1, so we're out of sync. + $('tbody tr:not(:hidden)', $(table)) + .removeClass('even') + .removeClass('odd') + .filter(':even') + .addClass('odd') + .end() + .filter(':odd') + .addClass('even'); +} + +Drupal.theme.prototype.tabledragChangedMarker = function () { + return '*'; +}; + Index: modules/block/block-admin-display-form.tpl.php =================================================================== RCS file: /cvs/drupal/drupal/modules/block/block-admin-display-form.tpl.php,v retrieving revision 1.1 diff -u -p -r1.1 block-admin-display-form.tpl.php --- modules/block/block-admin-display-form.tpl.php 5 Oct 2007 09:36:52 -0000 1.1 +++ modules/block/block-admin-display-form.tpl.php 24 Oct 2007 04:07:44 -0000 @@ -25,7 +25,15 @@ * @see theme_block_admin_display() */ ?> - + $title) { + drupal_add_tabledrag('blocks', 'block-region', 'match', 'sibling', 'block-region-'. $region, NULL, FALSE); + drupal_add_tabledrag('blocks', 'block-weight', 'order', 'sibling', 'block-weight-'. $region); + } +?> @@ -42,14 +50,19 @@ - + $data): ?> is_region_first): ?> - - - - + $title): ?> + region || $block_regions[$region]): ?> + + + + + region) { $row++; break; } ?> + + - + Index: modules/block/block-rtl.css =================================================================== RCS file: modules/block/block-rtl.css diff -N modules/block/block-rtl.css --- modules/block/block-rtl.css 10 Oct 2007 10:24:25 -0000 1.3 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,15 +0,0 @@ -/* $Id: block-rtl.css,v 1.3 2007/10/10 10:24:25 goba Exp $ */ - -#blocks td.block { - padding-left: inherit; - padding-right: 1.5em; -} -#blocks select { - margin-left: 24px; -} -#blocks select.progress-disabled { - margin-left: 0px; -} -#blocks .progress .bar { - float: right; -} Index: modules/block/block.admin.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/block/block.admin.inc,v retrieving revision 1.9 diff -u -p -r1.9 block.admin.inc --- modules/block/block.admin.inc 5 Oct 2007 09:35:09 -0000 1.9 +++ modules/block/block.admin.inc 24 Oct 2007 04:07:44 -0000 @@ -36,7 +36,7 @@ function block_admin_display_form(&$form init_theme(); $throttle = module_exists('throttle'); - $block_regions = array(BLOCK_REGION_NONE => '<'. t('none') .'>') + system_region_list($theme_key); + $block_regions = system_region_list($theme_key) + array(BLOCK_REGION_NONE => '<'. t('none') .'>'); // Build form tree $form = array( @@ -69,7 +69,7 @@ function block_admin_display_form(&$form ); $form[$key]['region'] = array( '#type' => 'select', - '#default_value' => $block['status'] ? (isset($block['region']) ? $block['region'] : system_default_region($theme_key)) : BLOCK_REGION_NONE, + '#default_value' => $block['region'], '#options' => $block_regions, ); @@ -82,20 +82,9 @@ function block_admin_display_form(&$form } } - // Attach the AHAH events to the submit button. Set the AHAH selector to every - // select element in the form. The AHAH event could be attached to every select - // element individually, but using the selector is more efficient, especially - // on a page where hundreds of AHAH enabled elements may be present. $form['submit'] = array( '#type' => 'submit', '#value' => t('Save blocks'), - '#ahah' => array( - 'path' => 'admin/build/block/list/js/'. $theme_key, - 'selector' => '#block-admin-display-form-wrapper select', - 'wrapper' => 'block-admin-display-form-wrapper', - 'event' => 'change', - 'effect' => 'fade', - ), ); return $form; @@ -115,104 +104,28 @@ function block_admin_display_form_submit } /** - * Javascript callback for AHAH replacement. Re-generate the form with the - * updated values and return necessary html. - */ -function block_admin_display_js($theme = NULL) { - // Load the cached form. - $form_cache = cache_get('form_'. $_POST['form_build_id'], 'cache_form'); - - // Set the new weights and regions for each block. - $blocks = array(); - foreach (element_children($form_cache->data) as $key) { - $field = $form_cache->data[$key]; - if (isset($field['info'])) { - $block = array( - 'module' => $field['module']['#value'], - 'delta' => $field['delta']['#value'], - 'info' => html_entity_decode($field['info']['#value'], ENT_QUOTES), - 'region' => $_POST[$key]['region'], - 'weight' => $_POST[$key]['weight'], - 'status' => $_POST[$key]['region'] == BLOCK_REGION_NONE ? 0 : 1, - ); - - $throttle = module_exists('throttle'); - if ($throttle) { - $block['throttle'] = $_POST[$key]['throttle']; - } - - if ($block['weight'] != $form_cache->data[$key]['weight']['#default_value'] || $block['region'] != $form_cache->data[$key]['region']['#default_value']) { - $changed_block = $block['module'] .'_'. $block['delta']; - } - - $blocks[] = $block; - } - } - - // Resort the blocks with the new weights. - usort($blocks, '_block_compare'); - - // Create a form in the new order. - $form_state = array('submitted' => FALSE); - $form = block_admin_display_form($form_state, $blocks, $theme); - - // Maintain classes set on individual blocks. - foreach (element_children($form_cache->data) as $key) { - if (isset($form_cache->data[$key]['#attributes'])) { - $form[$key]['#attributes'] = $form_cache->data[$key]['#attributes']; - } - } - - // Preserve the order of the new form while merging the previous data. - $form_order = array_flip(array_keys($form)); // Save the form order. - $form = array_merge($form_cache->data, $form); // Merge the data. - $form = array_merge($form_order, $form); // Put back into the correct order. - - // Add a permanent class to the changed block. - $form[$changed_block]['#attributes']['class'] = 'block-modified'; - - cache_set('form_'. $_POST['form_build_id'], $form, 'cache_form', $form_cache->expire); - - // Add a temporary class to mark the new AHAH content. - $form[$changed_block]['#attributes']['class'] = empty($form[$changed_block]['#attributes']['class']) ? 'ahah-new-content' : $form[$changed_block]['#attributes']['class'] .' ahah-new-content'; - $form['js_modified'] = array( - '#type' => 'value', - '#value' => TRUE, - ); - - $form['#post'] = $_POST; - $form['#theme'] = 'block_admin_display_form'; - - // Add messages to our output. - drupal_set_message(t('Your settings will not be saved until you click the Save blocks button.'), 'warning'); - - // Render the form. - drupal_alter('form', $form, array(), 'block_admin_display_form'); - $form = form_builder('block_admin_display_form', $form, $form_state); - - // Remove the wrapper from the form to prevent duplicate div IDs. - unset($form['#prefix'], $form['#suffix']); - - $output = drupal_render($form); - - // Return the output in JSON format. - drupal_json(array('status' => TRUE, 'data' => $output)); -} - -/** * Helper function for sorting blocks on admin/build/block. * * Active blocks are sorted by region, then by weight. * Disabled blocks are sorted by name. */ function _block_compare($a, $b) { - $status = $b['status'] - $a['status']; + global $theme_key; + static $regions; + + // We need the region list to correctly order by region. + if (!isset($regions)) { + $regions = array_flip(array_keys(system_region_list($theme_key))); + $regions[BLOCK_REGION_NONE] = count($regions); + } + // Separate enabled from disabled. + $status = $b['status'] - $a['status']; if ($status) { return $status; } - // Sort by region. - $place = strcmp($a['region'], $b['region']); + // Sort by region (in the order defined by theme .info file). + $place = $regions[$a['region']] - $regions[$b['region']]; if ($place) { return $place; } @@ -442,8 +355,9 @@ function block_box_delete_submit($form, function template_preprocess_block_admin_display_form(&$variables) { global $theme_key; - $variables['throttle'] = module_exists('throttle'); $block_regions = system_region_list($theme_key); + $variables['throttle'] = module_exists('throttle'); + $variables['block_regions'] = $block_regions + array(BLOCK_REGION_NONE => t('Disabled')); // Highlight regions on page to provide visual reference. foreach ($block_regions as $key => $value) { @@ -460,6 +374,10 @@ function template_preprocess_block_admin // Fetch region for current block. $region = $block['region']['#default_value']; + // Set special classes needed for table drag and drop. + $variables['form'][$i]['region']['#attributes']['class'] = 'block-region-select block-region-'. $region; + $variables['form'][$i]['weight']['#attributes']['class'] = 'block-weight block-weight-'. $region; + // Track first block listing to insert region header inside block_admin_display.tpl.php. $is_region_first = FALSE; if ($last_region != $region) { @@ -473,6 +391,7 @@ function template_preprocess_block_admin } } + $variables['block_listing'][$i]->region = $region; $variables['block_listing'][$i]->is_region_first = $is_region_first; $variables['block_listing'][$i]->row_class = isset($block['#attributes']['class']) ? $block['#attributes']['class'] : ''; $variables['block_listing'][$i]->block_modified = isset($block['#attributes']['class']) && strpos($block['#attributes']['class'], 'block-modified') !== FALSE ? TRUE : FALSE; @@ -483,6 +402,7 @@ function template_preprocess_block_admin $variables['block_listing'][$i]->throttle_check = $variables['throttle'] ? drupal_render($block['throttle']) : ''; $variables['block_listing'][$i]->configure_link = drupal_render($block['configure']); $variables['block_listing'][$i]->delete_link = !empty($block['delete']) ? drupal_render($block['delete']) : ''; + $variables['block_listing'][$i]->printed = FALSE; $last_region = $region; } Index: modules/block/block.css =================================================================== RCS file: /cvs/drupal/drupal/modules/block/block.css,v retrieving revision 1.5 diff -u -p -r1.5 block.css --- modules/block/block.css 10 Oct 2007 10:24:25 -0000 1.5 +++ modules/block/block.css 24 Oct 2007 04:07:44 -0000 @@ -3,8 +3,8 @@ #blocks td.region { font-weight: bold; } -#blocks td.block { - padding-left: 1.5em; /* LTR */ +#blocks tr.empty-region { + display: none; } .block-region { background-color: #ff6; @@ -12,12 +12,3 @@ margin-bottom: 4px; padding: 3px; } -#blocks select { - margin-right: 24px; /* LTR */ -} -#blocks select.progress-disabled { - margin-right: 0px; /* LTR */ -} -#blocks tr.ahah-new-content { - background-color: #ffd; -} Index: modules/block/block.js =================================================================== RCS file: modules/block/block.js diff -N modules/block/block.js --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/block/block.js 24 Oct 2007 04:07:44 -0000 @@ -0,0 +1,52 @@ +// $Id $ +/** + * Move a block in the blocks table from one region to another. If the + * destination region is currently empty, unhide the region header. Conversely, + * if the region becomes empty, hide the region header. + * + * This behavior is dependent on the tabledrag behavior, since it uses the + * defined classes initiallized in that behavior. + */ +Drupal.behaviors.blockRegionSelect = function(context) { + var table = $('table#blocks'); + var tableDrag = Drupal.tabledrag.blocks; // Get the blocks tabledrag object. + + // Add a custom handler for when a row is dropped, remove the region if empty. + tableDrag.onDrop = function(droppedRow) { + checkEmptyRegions(table); + }; + + $('select.block-region-select:not(.blockregionselect-processed)', context).each(function() { + $(this).change(function(event) { + // Make our new row and select field. + var row = $(this).parents('tr:first'); + var select = $(this); + + // Find the correct region and insert the row as the first in the region. + $('tr.region', table).each(function() { + if ($(this).is('.region-' + select[0].value)) { + // Ensure the region is visible. + $(this).removeClass('empty-region'); + // Add the new row and remove the old one. + $(this).after(row); + // Manually update weights and restripe. + tableDrag.updateFields(row.get(0)); + tableDrag.restripeTable(table.get(0)); + tableDrag.markChanged(row.get(0)); + } + }); + + // Remove empty regions. + checkEmptyRegions(table); + }); + $(this).addClass('blockregionselect-processed'); + }); + + var checkEmptyRegions = function(table) { + $('tr.region', table).each(function() { + if (!$(this).next().is('.draggable')) { + $(this).addClass('empty-region'); + } + }); + }; +}; \ No newline at end of file Index: modules/block/block.module =================================================================== RCS file: /cvs/drupal/drupal/modules/block/block.module,v retrieving revision 1.284 diff -u -p -r1.284 block.module --- modules/block/block.module 21 Oct 2007 18:59:01 -0000 1.284 +++ modules/block/block.module 24 Oct 2007 04:07:44 -0000 @@ -242,7 +242,7 @@ function _block_rehash() { if (!empty($old_blocks[$module][$delta])) { $block['status'] = $old_blocks[$module][$delta]->status; $block['weight'] = $old_blocks[$module][$delta]->weight; - $block['region'] = $old_blocks[$module][$delta]->region; + $block['region'] = empty($old_blocks[$module][$delta]->region) ? BLOCK_REGION_NONE : $old_blocks[$module][$delta]->region; $block['visibility'] = $old_blocks[$module][$delta]->visibility; $block['pages'] = $old_blocks[$module][$delta]->pages; $block['custom'] = $old_blocks[$module][$delta]->custom; Index: modules/system/system.css =================================================================== RCS file: /cvs/drupal/drupal/modules/system/system.css,v retrieving revision 1.37 diff -u -p -r1.37 system.css --- modules/system/system.css 10 Oct 2007 10:24:25 -0000 1.37 +++ modules/system/system.css 24 Oct 2007 04:07:45 -0000 @@ -11,6 +11,9 @@ tr.even, tr.odd { border-bottom: 1px solid #ccc; padding: 0.1em 0.6em; } +tr.highlight { + background-color: #ffd; +} td.active { background-color: #ddd; } @@ -333,6 +336,27 @@ html.js .resizable-textarea textarea { } /* +** Table drag and drop. +*/ +.tabledrag-handle { + width: 30px; + cursor: move; + float: left; + margin: -0.6em 0pt; + padding: 0.6em 0.5em; +} +.tabledrag-handle .handle { + display: block; + margin-top: 0.38em; + height: 13px; + width: 13px; + background: url(../../misc/draggable.png) no-repeat center 0px; +} +.tabledrag-handle-hover .handle { + background-position: center -20px; +} + +/* ** Teaser splitter */ .joined + .grippie { Index: themes/garland/style.css =================================================================== RCS file: /cvs/drupal/drupal/themes/garland/style.css,v retrieving revision 1.27 diff -u -p -r1.27 style.css --- themes/garland/style.css 11 Oct 2007 09:51:29 -0000 1.27 +++ themes/garland/style.css 24 Oct 2007 04:07:46 -0000 @@ -226,6 +226,10 @@ tr.even { background-color: #fff; } +tr.highlight { + background-color: #ffd; +} + tr.odd td.active { background-color: #ddecf5; }
region_title; ?>
block_title; ?>block_modified ? '*' : ''; ?> region_select; ?> weight_select; ?>