You are here

function ctools_context_handler_get_task_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_task_object()

Create an object suitable for use with the context system that kind of expects things in a certain, kind of clunky format. This one adds in arguments from the task.

4 calls to ctools_context_handler_get_task_object()
ctools_context_handler_edit_context in includes/context-task-handler.inc
Edit contexts that go with this panel.
ctools_context_handler_get_all_contexts in includes/context-task-handler.inc
Load the contexts for a task and task handler together.
page_manager_context_cache_get in page_manager/page_manager.module
page_manager_http_response_admin_summary in page_manager/plugins/task_handlers/http_response.inc

File

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

Code

function ctools_context_handler_get_task_object($task, $subtask, $handler) {
  $object = new stdClass();
  $object->name = !empty($handler->name) ? $handler->name : 'temp';
  $object->base_contexts = ctools_context_handler_get_base_contexts($task, $subtask, TRUE);
  $object->arguments = ctools_context_handler_get_task_arguments($task, $subtask);
  $object->contexts = isset($handler->conf['contexts']) ? $handler->conf['contexts'] : array();
  $object->relationships = isset($handler->conf['relationships']) ? $handler->conf['relationships'] : array();
  return $object;
}