function space_customizer_block::customize in Spaces 6.2
Same name and namespace in other branches
- 6 spaces.module \space_customizer_block::customize()
Implementation of customize().
1 call to space_customizer_block::customize()
- spaces_context_active_contexts_alter in ./
spaces.module - Implementation of hook_context_active_contexts_alter().
File
- ./
spaces.spaces.inc, line 292
Class
- space_customizer_block
- Customizer for feature blocks.
Code
function customize($space, $identifier, &$block = NULL) {
// Unset disabled blocks and change weights based on customizer settings. See spaces_context_active_contexts_alter.
if (!empty($space->customizer['block'][$identifier])) {
$customizer = $space->customizer['block'][$identifier];
foreach ($block as $key => $b) {
// @TODO: remove this once context is less confused about itself.
$b = (array) $b;
$block[$key] = (array) $block[$key];
$bid = "{$b['module']}-{$b['delta']}";
// If the block is not enabled, yank it out of the blocks array
if (!empty($customizer[$b['region']][$bid])) {
if (isset($customizer[$b['region']][$bid]['status']) && $customizer[$b['region']][$bid]['status'] === 0) {
unset($block[$key]);
}
if (isset($customizer[$b['region']][$bid]['weight'])) {
$block[$key]['weight'] = $customizer[$b['region']][$bid]['weight'];
}
}
}
}
}