You are here

function context_reaction_block::execute in Context 6

Same name and namespace in other branches
  1. 6.3 plugins/context_reaction_block.inc \context_reaction_block::execute()
  2. 7.3 plugins/context_reaction_block.inc \context_reaction_block::execute()

Execute.

File

plugins/context_reaction_block.inc, line 211

Class

context_reaction_block
Expose blocks as context reactions.

Code

function execute($region) {

  // If the context_block querystring param is set, switch to AJAX rendering.
  // Note that we check the output buffer for any content to ensure that we
  // are not in the middle of a PHP template render.
  if (isset($_GET['context_block']) && !ob_get_contents()) {
    return $this
      ->render_ajax($_GET['context_block']);
  }
  if ($this
    ->is_enabled_region($region)) {
    return theme('context_block_editable_region', $region, $this
      ->block_list($region), $this
      ->is_editable());
  }
  return '';
}