You are here

function context_field_context_condition::create_context in Context Field 7

File

plugins/context_field_context_condition.inc, line 38
context_field_context_condition.inc

Class

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

Code

function create_context($context_name) {
  $context = (object) array(
    'name' => $context_name,
    'tag' => 'Context Field',
    'reactions' => array(),
    'conditions' => array(
      'context_field' => array(
        'values' => array(
          1 => 1,
        ),
      ),
    ),
  );
  context_save($context);
  return $context;
}