You are here

function ctools_context_handler_get_handler_object in Chaos Tool Suite (ctools) 6

Same name and namespace in other branches
  1. 7 includes/context-task-handler.inc \ctools_context_handler_get_handler_object()

Create an object suitable for use with the context system that kind of expects things in a certain, kind of clunky format.

1 call to ctools_context_handler_get_handler_object()
ctools_context_handler_get_handler_contexts in includes/context-task-handler.inc
Load the contexts for a task handler.

File

includes/context-task-handler.inc, line 263
Support for creating 'context' type task handlers.

Code

function ctools_context_handler_get_handler_object($handler) {
  $object = new stdClass();
  $object->name = $handler->name;
  $object->contexts = isset($handler->conf['contexts']) ? $handler->conf['contexts'] : array();
  $object->relationships = isset($handler->conf['relationships']) ? $handler->conf['relationships'] : array();
  return $object;
}