function entityform_views_pre_view in Entityform 7.2
Same name and namespace in other branches
- 7 entityform.module \entityform_views_pre_view()
Implements hook_views_pre_view().
This add all Fields for the Bundle to the View at runtime View Requirements 1. First argument must bundle machine name 2. All Fields will added if the if the show_display_id starts with "autofields_
File
- ./
entityform.module, line 1547 - Module for the Entityform Entity - a starting point to create your own Entity and associated administration interface
Code
function entityform_views_pre_view(&$view, &$display_id, &$args) {
if ($view->base_table == 'entityform') {
$view_mode = _entityform_get_view_mode_for_view($view, $display_id);
if ($view_mode && empty($view->display[$display_id]->entityform_settings['autofields'])) {
// We have to have the Entityform Type as the first argument to this View to get this to work.
if (isset($view->args[0])) {
$type = $view->args[0];
_entityform_view_add_all_fields($view, $display_id, $type, $view_mode);
}
}
}
return;
}