function ds_extras_vd_field_ui in Display Suite 7.2
Same name and namespace in other branches
- 7 modules/ds_extras/ds_extras.vd.inc \ds_extras_vd_field_ui()
Return Field UI display screen for a view and bundle.
Parameters
$bundle: The name of the bundle
1 call to ds_extras_vd_field_ui()
- ds_extras_vd_manage in modules/
ds_extras/ includes/ ds_extras.vd.inc - Edit the display or remove a views display.
File
- modules/
ds_extras/ includes/ ds_extras.vd.inc, line 157 - Views displays functions.
Code
function ds_extras_vd_field_ui($bundle) {
global $conf;
// Use drupal_build_form instead of drupal_get_form.
$form_state = array();
$arguments = array(
'ds_views',
$bundle,
'default',
);
$form_state['build_info']['args'] = $arguments;
$form_state['no_view_mode_suggestions'] = TRUE;
$form_state['no_panels'] = TRUE;
form_load_include($form_state, 'inc', 'field_ui', 'field_ui.admin');
form_load_include($form_state, 'inc', 'ds_extras', 'includes/ds_extras.vd');
// Deny access to field_group if it exists.
if (module_exists('field_group')) {
$form_state['no_field_group'] = TRUE;
}
// Build form.
$build = drupal_build_form('field_ui_display_overview_form', $form_state);
// Deny access to view modes.
$build['additional_settings']['modes']['#access'] = FALSE;
// Deny access to disabling blocks and regions.
$build['additional_settings']['ds_layouts']['hide_sidebars']['#access'] = FALSE;
// Deny access to fields table if there's no layout.
if (!ds_get_layout('ds_views', $bundle, 'default')) {
$build['fields']['#access'] = FALSE;
}
// Add additional validate function so we can remove notices.
if (module_exists('field_group')) {
array_unshift($build['#validate'], 'ds_vd_field_ui_fix_notices');
}
return $build;
}