You are here

protected function SimplenewsSourceNode::resetContext in Simplenews 7

Reset the context.

2 calls to SimplenewsSourceNode::resetContext()
SimplenewsSourceNode::getBodyWithFormat in includes/simplenews.source.inc
Get the body with the requested format.
SimplenewsSourceNode::getFooterWithFormat in includes/simplenews.source.inc
Get the footer in the specified format.

File

includes/simplenews.source.inc, line 629
Contains SimplenewsSource interface and implementations.

Class

SimplenewsSourceNode
Simplenews source implementation based on nodes for a single subscriber.

Code

protected function resetContext() {

  // Switch back to the previous user.
  if ($this->uid) {
    simplenews_revert_user();
  }

  // Switch language back.
  if (!empty($this->original_language)) {
    $GLOBALS['language'] = $this->original_language;
    $GLOBALS['language_url'] = $this->original_language;
    if (module_exists('i18n_select')) {
      $GLOBALS['language_content'] = $this->original_language;
    }
  }
}