You are here

function ContextConditionBreakpoint::execute in Context Breakpoint 7

File

plugins/context_condition_breakpoint.inc, line 280
context_condition_resolution.inc Provides the context CTools plugin base class.

Class

ContextConditionBreakpoint
@file context_condition_resolution.inc Provides the context CTools plugin base class.

Code

function execute() {
  $active_contexts = array();
  $resolutionData = array();

  // Check if there is a valid resolution stored in the cookie.
  if (isset($_COOKIE[$this->cookieName])) {
    $active_contexts = $this
      ->parseCookie($_COOKIE[$this->cookieName]);
  }
  if (isset($_COOKIE[$this->resolutionCookieName])) {
    $resolutionData = $this
      ->parseResolutionCookie($_COOKIE[$this->resolutionCookieName]);
  }
  if ($active_contexts) {
    foreach ($this
      ->get_contexts() as $context) {
      if (in_array($context->name, $active_contexts)) {
        $this
          ->condition_met($context);
      }
    }
  }
}