function views_view_field_handler_include_view::render in Views PDF 6
Same name and namespace in other branches
- 8 modules/views_view_field/views_view_field_handler_include_view.inc \views_view_field_handler_include_view::render()
- 7.3 modules/views_view_field/views_view_field_handler_include_view.inc \views_view_field_handler_include_view::render()
- 7 modules/views_view_field/views_view_field_handler_include_view.inc \views_view_field_handler_include_view::render()
- 7.2 modules/views_view_field/views_view_field_handler_include_view.inc \views_view_field_handler_include_view::render()
Renders the field. For rendering the new views is created an added. For PDF displays the two PDF classes where merged.
File
- modules/
views_view_field/ views_view_field_handler_include_view.inc, line 129 - Plugin for the views include field
Class
- views_view_field_handler_include_view
- This class contains the functionality to add a view as a new field in another view.
Code
function render($values) {
if (!empty($this->options['exclude'])) {
return '';
}
$displayType = $this->view->display_handler
->get_style_type();
$currentDisplay = $this->view->current_display;
$tokens = $this
->get_render_tokens('');
$args = array();
foreach ($this->options['args'] as $arg) {
$args[] = str_replace(array_keys($tokens), $tokens, $arg);
}
$view_name = $this->options['view'];
$view = views_get_view($view_name);
$view
->set_arguments($args);
// Try same display as the current
if (!$view
->set_display($currentDisplay)) {
// Try the display type
if (!$view
->set_display($displayType . '_1')) {
// Use the default:
$view
->init_display();
}
}
$view
->pre_execute();
$view
->execute();
$view
->init_style();
// Important only for pdf views. With this action we assign the
// PDF document to the new view
if (isset($this->view->pdf) && is_object($this->view->pdf)) {
$view->pdf =& $this->view->pdf;
}
if (is_object($view->style_plugin)) {
return $view->style_plugin
->render();
}
else {
return 'style plugin not found';
}
}