protected function context_reaction_block::max_block_weight in Context 7.3
Same name and namespace in other branches
- 6.3 plugins/context_reaction_block.inc \context_reaction_block::max_block_weight()
- 6 plugins/context_reaction_block.inc \context_reaction_block::max_block_weight()
Generate the safe weight range for a block being added to a region such that there are enough potential unique weights to support all blocks.
1 call to context_reaction_block::max_block_weight()
- context_reaction_block::options_form in plugins/
context_reaction_block.inc - Options form.
File
- plugins/
context_reaction_block.inc, line 455
Class
- context_reaction_block
- Expose blocks as context reactions.
Code
protected function max_block_weight() {
$blocks = $this
->get_blocks();
// Add 2 to make sure there's space at either end of the block list.
return round((count($blocks) + 2) / 2);
}