You are here

function _sharedblocks_revert_globals in Shared Blocks 7.2

1 call to _sharedblocks_revert_globals()
sharedblocks_get_block in ./sharedblocks.publish.inc
Fetch a block in the same manner as _block_render_blocks().

File

./sharedblocks.publish.inc, line 156
Publish block page callbacks for the sharedblocks module.

Code

function _sharedblocks_revert_globals() {
  $values =& drupal_static('sharedblocks_globals');
  if (!isset($values)) {
    return;
  }

  // Revert the current path.
  if (isset($values['q'])) {
    $_GET['q'] = $values['q'];
    drupal_static_reset('drupal_is_front_page');
  }

  // Revert the current user and session.
  if (isset($values['user'])) {
    $GLOBALS['user'] = $values['user'];
    drupal_save_session($values['session']);
  }

  // Clear out the original globals since they have been reset.
  drupal_static_reset('sharedblocks_globals');
}