function context_reaction_block::is_editable_check

cis7 context_reaction_block.inc context_reaction_block::is_editable_check($context_blocks)
cle7 context_reaction_block.inc context_reaction_block::is_editable_check($context_blocks)
elmsmedia7 context_reaction_block.inc context_reaction_block::is_editable_check($context_blocks)
icor7 context_reaction_block.inc context_reaction_block::is_editable_check($context_blocks)
meedjum_blog7 context_reaction_block.inc context_reaction_block::is_editable_check($context_blocks)
mooc7 context_reaction_block.inc context_reaction_block::is_editable_check($context_blocks)

Determine if there is an active context editor block, and set a flag. We will set a flag so that we can make sure that blocks with empty content have some default content. This is needed so the save of the context inline editor does not remove the blocks with no content.

1 call to context_reaction_block::is_editable_check()
context_reaction_block::block_list in sites/all/modules/ulmus/context/plugins/context_reaction_block.inc
An alternative version of block_list() that provides any context enabled blocks.

File

sites/all/modules/ulmus/context/plugins/context_reaction_block.inc, line 416

Class

context_reaction_block
Expose blocks as context reactions.

Code

function is_editable_check($context_blocks) {
  foreach ($context_blocks as $r => $blocks) {
    if (isset($blocks['context_ui-editor'])) {
      $block = $blocks['context_ui-editor'];
      // see if the editor is actually enabled, lifted from _block_render_blocks
      if (!count(module_implements('node_grants')) && ($_SERVER['REQUEST_METHOD'] == 'GET' || $_SERVER['REQUEST_METHOD'] == 'HEAD') && ($cid = _block_get_cache_id($block)) && ($cache = cache_get($cid, 'cache_block'))) {
        $array = $cache->data;
      }
      else {
        $array = module_invoke($block->module, 'block_view', $block->delta);
        drupal_alter(array('block_view', "block_view_{$block->module}_{$block->delta}"), $array, $block);
      }
      if (!empty($array['content'])) {
        context_set('context_ui', 'context_ui_editor_present', TRUE);
      }
      break;
    }
  }
}
Error | ELMSLN API

Error

×

Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/api.elmsln.org/includes/common.inc:2791) in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/api.elmsln.org/sites/all/modules/apc/drupal_apc_cache.inc).
The website encountered an unexpected error. Please try again later.