function views_content_context_view_create
2 string references to 'views_content_context_view_create'
- view.inc in views_content/plugins/contexts/view.inc
- Plugin to provide a node context. A node context is a node wrapped in a
context object that can be utilized by anything that accepts contexts.
- _views_content_get_context_from_display in views_content/views_content.module
- Get the child plugin for a view context display.
File
-
views_content/plugins/contexts/view.inc, line 72
Code
function views_content_context_view_create($empty, $data = NULL, $conf = FALSE, $plugin = array()) {
$context = new ctools_context('view');
$context->plugin = 'view';
if ($empty) {
return $context;
}
if ($conf) {
if (is_array($data) && !empty($data['view'])) {
list($name, $display_id) = explode(':', $data['view'], 2);
$data = views_get_view($name);
if ($data) {
$data->set_display($display_id);
}
}
elseif (!empty($plugin['view name'])) {
$data = views_get_view($plugin['view name']);
$data->set_display($plugin['view display id']);
}
}
if (is_object($data) && $data->current_display != 'default') {
$context->data = array(
'name' => $data->name,
'display' => $data->current_display,
'args' => $data->args,
);
$context->view = NULL;
$context->title = $data->get_title();
$context->argument = $data->name . ':' . $data->current_display;
$context->restrictions['base'] = array(
$data->base_table,
);
return $context;
}
}