diff --git plugins/context_reaction_block.inc plugins/context_reaction_block.inc index 864f15b..3630060 100644 --- plugins/context_reaction_block.inc +++ plugins/context_reaction_block.inc @@ -39,14 +39,15 @@ class context_reaction_block extends context_reaction { '#suffix' => '', ); foreach ($this->get_blocks() as $block) { - if (!isset($form['selector'][$block->module])) { - $form['selector'][$block->module] = array( + $group = isset($block->context_group) ? $block->context_group : $block->module; + if (!isset($form['selector'][$group])) { + $form['selector'][$group] = array( '#type' => 'checkboxes', - '#title' => $modules[$block->module], + '#title' => isset($block->context_group) ? $block->context_group : $modules[$block->module], '#options' => array(), ); } - $form['selector'][$block->module]['#options'][$block->bid] = check_plain($block->info); + $form['selector'][$group]['#options'][$block->bid] = check_plain($block->info); } ksort($form['selector']); diff --git theme/context_reaction_block.theme.inc theme/context_reaction_block.theme.inc index 97a2710..2728316 100644 --- theme/context_reaction_block.theme.inc +++ theme/context_reaction_block.theme.inc @@ -85,11 +85,13 @@ function template_preprocess_context_block_browser(&$vars) { $blocks = array(); // Group blocks by module. foreach ($vars['blocks'] as $block) { - if (!isset($categories[$block->module])) { + $group = isset($block->context_group) ? $block->context_group : $block->module; + if (!isset($categories[$group])) { $info = system_get_info('module', $block->module); - $categories['#options'][$block->module] = !empty($info['name']) ? $info['name'] : $block->module; + $title = $group = isset($block->context_group) ? $block->context_group : (!empty($info['name']) ? $info['name'] : $block->module); + $categories['#options'][$group] = $title; } - $blocks[$block->module][$block->bid] = $block; // Don't call theme('context_block_browser_item') to allow others to alter. + $blocks[$group][$block->bid] = $block; // Don't call theme('context_block_browser_item') to allow others to alter. } $vars['categories'] = $categories; // Don't call theme('select') here to allow further preprocesses to alter the element. $vars['blocks'] = $blocks;