function styles_ui_delete_confirm in Styles 7.2
Menu callback; delete a style.
1 string reference to 'styles_ui_delete_confirm'
- styles_ui_menu in contrib/
styles_ui/ styles_ui.module - Implements hook_menu().
File
- contrib/
styles_ui/ styles_ui.admin.inc, line 311 - Administrative page callbacks for the Styles UI module.
Code
function styles_ui_delete_confirm($form, &$form_state, $field_type, $style_name) {
$form['field_type'] = array(
'#type' => 'value',
'#value' => $field_type,
);
$form['style_name'] = array(
'#type' => 'value',
'#value' => $style_name,
);
$styles = styles_default_styles($field_type);
$style = $styles['styles'][$style_name];
if ($style['storage'] == STYLES_STORAGE_OVERRIDE) {
$delete = 'revert';
}
else {
$delete = 'delete';
}
$caption = '<p>' . t('This action cannot be undone.') . '</p>';
$containers = styles_default_containers($field_type);
$cancel_path = $containers['admin']['path'];
$form['containers'] = array(
'#type' => 'value',
'#value' => $containers,
);
$message = t('Are you sure you want to @delete the %field_type style %style_name?', array(
'@delete' => $delete,
'%field_type' => $field_type,
'%style_name' => $style_name,
));
return confirm_form($form, $message, $cancel_path, $caption, t('@delete', array(
'@delete' => ucfirst($delete),
)));
}