You are here

function defaultcontent_condition::execute in Default Content 7.2

Same name and namespace in other branches
  1. 7 context/plugins/defaultcontent_condition.inc \defaultcontent_condition::execute()

Execute.

File

context/plugins/defaultcontent_condition.inc, line 43

Class

defaultcontent_condition

Code

function execute($node) {
  if (!isset($node->machine_name)) {
    return;
  }
  if ($this
    ->condition_used()) {
    foreach ($this
      ->get_contexts() as $context) {
      $machine_names = $this
        ->fetch_from_context($context, 'values');
      if (in_array($node->machine_name, $machine_names)) {
        $this
          ->condition_met($context);
      }
    }
  }
}