function openlayers_presets_ui_presets_manage_delete in Openlayers 6
Menu Callback for Preset Delete Form
1 string reference to 'openlayers_presets_ui_presets_manage_delete'
- openlayers_presets_ui_presets_manage in modules/
openlayers_presets_ui/ includes/ openlayers_presets_ui.ui.inc - Menu Callback for Preset Routing
File
- modules/
openlayers_presets_ui/ includes/ openlayers_presets_ui.ui.inc, line 676 - This file holds the functions for the openlayers presets ui
Code
function openlayers_presets_ui_presets_manage_delete(&$form_state, $preset = array()) {
// Ensure we are not deleting any coded presets
if ($preset['type'] == OPENLAYERS_STORAGE_DEFAULT) {
drupal_set_message(t('Cannot delete default preset.'), 'error');
drupal_goto('admin/settings/openlayers/presets');
}
// Create delete form
$form = array();
$form['preset_name'] = array(
'#type' => 'value',
'#value' => $preset['preset_name'],
);
if ($preset['type'] == OPENLAYERS_STORAGE_OVERRIDE) {
return confirm_form($form, t('Are you sure you want to revert the preset %preset?', array(
'%preset' => $preset['preset_title'],
)), 'admin/settings/openlayers/presets', t('This will delete the preset in the database and revert to the preset in a feature or code. This action cannot be undone.'), t('Delete'), t('Cancel'));
}
else {
return confirm_form($form, t('Are you sure you want to delete the preset %preset?', array(
'%preset' => $preset['preset_title'],
)), 'admin/settings/openlayers/presets', t('This action cannot be undone.'), t('Delete'), t('Cancel'));
}
}