diff --git a/plugins/context_reaction_block.css b/plugins/context_reaction_block.css index e82a6a6..40fc512 100644 --- a/plugins/context_reaction_block.css +++ b/plugins/context_reaction_block.css @@ -193,6 +193,12 @@ body.context-editing .draggable:hover a.context-block-remove { #context-blockform td.blocks .label { background:#eee; } #context-blockform td.blocks .label a { float:right; } +#context-blockform td.blocks div.exposed div.form-item, +#context-blockform td.blocks div.exposed select { + display: block !important; + clear: left; +} + #context-ui-items #context-blockform { font-size:11px; line-height:15px; diff --git a/plugins/context_reaction_block.inc b/plugins/context_reaction_block.inc index 8c545e1..da4e595 100644 --- a/plugins/context_reaction_block.inc +++ b/plugins/context_reaction_block.inc @@ -72,12 +72,29 @@ class context_reaction_block extends context_reaction { ); foreach ($this->get_blocks($region, $context) as $block) { if (!empty($block->context)) { + if (variable_get('context_reaction_block_expose_weights', FALSE)) { + $weight_form = array( + '#type' => 'weight', + '#title' => t('Weight'), + '#delta' => $weight_delta, + '#default_value' => $block->weight, + '#prefix' => '
', + '#suffix' => '
', + ); + } + else { + $weight_form = array( + '#type' => 'weight', + '#delta' => $weight_delta, + '#default_value' => 0 + ); + } $form['blocks'][$region][$block->bid] = array( '#value' => check_plain($block->info), '#weight' => $block->weight, '#type' => 'markup', '#tree' => TRUE, - 'weight' => array('#type' => 'weight', '#delta' => $weight_delta, '#default_value' => $block->weight), + 'weight' => $weight_form, ); } } @@ -107,7 +124,7 @@ class context_reaction_block extends context_reaction { 'module' => $block_info[$data->bid]->module, 'delta' => $block_info[$data->bid]->delta, 'region' => $region, - 'weight' => $data->weight, + 'weight' => isset($values['blocks'][$region][$data->bid]['weight']) ? $values['blocks'][$region][$data->bid]['weight'] : $position, ); } } @@ -201,6 +218,12 @@ class context_reaction_block extends context_reaction { '#default_value' => variable_get('context_reaction_block_all_regions', FALSE), '#description' => t('Show all regions including those that are empty. Enable if you are administering your site using the inline editor.') ); + $form['context_reaction_block_expose_weights'] = array( + '#title' => t('Expose numeric block weights'), + '#type' => 'checkbox', + '#default_value' => variable_get('context_reaction_block_expose_weights', FALSE), + '#description' => t('Expose block weights allowing you to set them manually. This can be useful if you have complex overlapping contexts that place blocks in the same regions. Note that newly added blocks must be saved before their weights are exposed. Also note that any manual settings will be overridden when using the inline editor.') + ); return $form; }