function ds_revert_layout_field_settings_form in Display Suite 7.2
Same name and namespace in other branches
- 7 ds.field_ui.inc \ds_revert_layout_field_settings_form()
Menu callback: Revert layout and field settings form.
1 string reference to 'ds_revert_layout_field_settings_form'
- _ds_menu in includes/
ds.registry.inc - Implements hook_menu().
File
- includes/
ds.field_ui.inc, line 213 - Field UI functions for Display Suite.
Code
function ds_revert_layout_field_settings_form($form, &$form_state, $id = '') {
$layout = new stdClass();
ctools_include('export');
$ds_layout_settings = ctools_export_crud_load_all('ds_layout_settings');
if (isset($ds_layout_settings[$id])) {
$layout = $ds_layout_settings[$id];
}
if (isset($layout) && $layout->export_type == 3) {
$form['#layout'] = $layout;
return confirm_form($form, t('Are you sure you want to revert the layout for %layout?', array(
'%layout' => implode(', ', explode('|', $layout->id)),
)), drupal_get_destination(), t('This action cannot be undone.'), t('Revert'), t('Cancel'));
}
else {
drupal_set_message(t('This operation is not possible.'));
}
}