1 views_ui_base_views_wizard.php | protected ViewsUiBaseViewsWizard::default_display_options($form, $form_state) |
Most subclasses will need to override this method to provide some fields or a different row plugin.
File
- core/
modules/ views_ui/ wizards/ views_ui_base_views_wizard.php, line 637 - Provides the interface and base class for Views Wizard plugins.
Class
- ViewsUiBaseViewsWizard
- A very generic Views Wizard class - can be constructed for any base table.
Code
protected function default_display_options($form, $form_state) {
$display_options = array();
$display_options['access']['type'] = 'none';
$display_options['cache']['type'] = 'none';
$display_options['query']['type'] = 'views_query';
$display_options['exposed_form']['type'] = 'basic';
$display_options['pager']['type'] = 'full';
$display_options['style_plugin'] = 'default';
$display_options['row_plugin'] = 'fields';
// Add a least one field so the view validates and the user has already
// preview. Therefore the base field could provide '[defaults][field]' in
// it's base settings. If there is nothing like this choose the first field
// with a field handler.
$data = views_fetch_data($this->base_table);
if (isset($data['table']['base']['defaults']['field'])) {
$field = $data['table']['base']['defaults']['field'];
}
else {
foreach ($data as $field => $field_data) {
if (isset($field_data['field']['handler'])) {
break;
}
}
}
$display_options['fields'][$field] = array(
'table' => $this->base_table,
'field' => $field,
'id' => $field,
);
return $display_options;
}