You are here

function rules_action_context_rules_set_context in Context Rules 6

Same name and namespace in other branches
  1. 7 context_rules.rules.inc \rules_action_context_rules_set_context()

Set a context via rules action

Parameters

$context: An object containing the context data

$value: An object containing the context data

Return value

An array of the newly set context

TODO: Offer option to force or respect context conditions

File

./context_rules.rules.inc, line 66
Provides rules integrations for the Context module

Code

function rules_action_context_rules_set_context($settings) {
  if ($context = context_load($settings['context'])) {
    if (context_set('context', $context->name, $context)) {
      return TRUE;
    }
  }
}