You are here

function context_block_view_alter in Context 7.3

hook_block_view_alter - if the context editor block is on this page, ensure that all blocks have some content so that empty blocks are not dropped

File

./context.module, line 596

Code

function context_block_view_alter(&$data, $block) {
  if (context_isset('context_ui', 'context_ui_editor_present') && empty($data['content'])) {
    $data['content']['#markup'] = "<div class='context-block-empty-content'>" . t('This block appears empty when displayed on this page.') . "</div>";
    $data['context_block_hidden'] = TRUE;
  }
}