You are here

protected function context_reaction_block::editable_block in Context 7.3

Add markup for making a block editable.

2 calls to context_reaction_block::editable_block()
context_reaction_block::block_list in plugins/context_reaction_block.inc
An alternative version of block_list() that provides any context enabled blocks.
context_reaction_block::render_ajax in plugins/context_reaction_block.inc
Block renderer for AJAX requests. Triggered when $_GET['context_block'] is set. See ->execute() for how this is called.

File

plugins/context_reaction_block.inc, line 306

Class

context_reaction_block
Expose blocks as context reactions.

Code

protected function editable_block($block) {
  if (!empty($block->content)) {
    $block->content['#theme_wrappers'][] = 'context_block_edit_wrap';
  }
  else {

    // the block alter in context.module should ensure that blocks are never
    // empty if the inline editor is present but in the case that they are,
    // warn that editing the context is likely to cause this block to be dropped
    drupal_set_message(t('The block with delta @delta from module @module is not compatible with the inline editor and will be dropped from the context containing it if you edit contexts here', array(
      '@delta' => $block->delta,
      '@module' => $block->module,
    )), 'warning');
  }
  return $block;
}