function context_condition_node::execute

cis7 context_condition_node.inc context_condition_node::execute($node, $op)
cle7 context_condition_node.inc context_condition_node::execute($node, $op)
elmsmedia7 context_condition_node.inc context_condition_node::execute($node, $op)
icor7 context_condition_node.inc context_condition_node::execute($node, $op)
meedjum_blog7 context_condition_node.inc context_condition_node::execute($node, $op)
mooc7 context_condition_node.inc context_condition_node::execute($node, $op)
3 methods override context_condition_node::execute()
context_condition_bookroot::execute in sites/all/modules/ulmus/context/plugins/context_condition_bookroot.inc
context_condition_node_taxonomy::execute in sites/all/modules/ulmus/context/plugins/context_condition_node_taxonomy.inc
date_context_date_condition::execute in sites/all/modules/ulmus/date/date_context/plugins/date_context_date_condition.inc

File

sites/all/modules/ulmus/context/plugins/context_condition_node.inc, line 47

Class

context_condition_node
Expose node views/node forms of specific node types as a context condition.

Code

function execute($node, $op) {
  foreach ($this->get_contexts($node->type) as $context) {
    // Check the node form option.
    $options = $this->fetch_from_context($context, 'options');
    if ($op === 'form') {
      $options = $this->fetch_from_context($context, 'options');
      if (!empty($options['node_form']) && in_array($options['node_form'], array(CONTEXT_NODE_FORM, CONTEXT_NODE_FORM_ONLY))) {
        $this->condition_met($context, $node->type);
      }
    }
    elseif (empty($options['node_form']) || $options['node_form'] != CONTEXT_NODE_FORM_ONLY) {
      $this->condition_met($context, $node->type);
    }
  }
}