function context_condition_met

cis7 context.module context_condition_met($context, $condition, $reset = FALSE)
cle7 context.module context_condition_met($context, $condition, $reset = FALSE)
elmsmedia7 context.module context_condition_met($context, $condition, $reset = FALSE)
icor7 context.module context_condition_met($context, $condition, $reset = FALSE)
meedjum_blog7 context.module context_condition_met($context, $condition, $reset = FALSE)
mooc7 context.module context_condition_met($context, $condition, $reset = FALSE)

Queue or activate contexts that have met the specified condition.

Parameters

$context: The context object to queue or activate.

$condition: String. Name for the condition that has been met.

$reset: Reset flag for the queue static cache.

1 call to context_condition_met()
context_condition::condition_met in sites/all/modules/ulmus/context/plugins/context_condition.inc
Marks a context as having met this particular condition.

File

sites/all/modules/ulmus/context/context.module, line 376

Code

function context_condition_met($context, $condition, $reset = FALSE) {
  static $queue;
  if (!isset($queue) || $reset) {
    $queue = array();
  }
  if (!context_isset('context', $context->name)) {
    // Context is using AND mode. Queue it.
    if (isset($context->condition_mode) && $context->condition_mode == CONTEXT_CONDITION_MODE_AND) {
      $queue[$context->name][$condition] = $condition;

      // If all conditions have been met. set the context.
      if (!array_diff(array_keys($context->conditions), $queue[$context->name])) {
        context_set('context', $context->name, $context);
      }
    }
    // Context is using OR mode. Set it.
    else {
      context_set('context', $context->name, $context);
    }
  }
}