diff --git a/modules/block/block.admin.inc b/modules/block/block.admin.inc index 26a8eada17ff49947715d1d72f0bd08d48fecfc4..32fa80716daed8054a5da67125ffc0163f7a0bb1 100644 --- a/modules/block/block.admin.inc +++ b/modules/block/block.admin.inc @@ -38,6 +38,11 @@ function block_admin_display_form(&$form_state, $blocks, $theme = NULL) { $throttle = module_exists('throttle'); $block_regions = system_region_list($theme_key) + array(BLOCK_REGION_NONE => '<'. t('none') .'>'); + // Weights range from -delta to +delta, so delta should be at least half + // of the amount of blocks present. This makes sure all blocks in the same + // region get an unique weight. + $weight_delta = round(count($blocks) / 2); + // Build form tree $form = array( '#action' => arg(4) ? url('admin/build/block/list/'. $theme_key) : url('admin/build/block'), @@ -64,6 +69,7 @@ function block_admin_display_form(&$form_state, $blocks, $theme = NULL) { $form[$key]['weight'] = array( '#type' => 'weight', '#default_value' => $block['weight'], + '#delta' => $weight_delta, ); $form[$key]['region'] = array( '#type' => 'select',