function sharebar_button_confirm_delete in ShareBar 7
Same name and namespace in other branches
- 6 sharebar.admin.inc \sharebar_button_confirm_delete()
- 7.2 sharebar.admin.inc \sharebar_button_confirm_delete()
Form builder: delete buttons.
1 string reference to 'sharebar_button_confirm_delete'
- sharebar_menu in ./
sharebar.module - Implements hook_menu().
File
- ./
sharebar.admin.inc, line 164 - Admin page callbacks for the block module.
Code
function sharebar_button_confirm_delete($form, &$form_state) {
$mname = arg(4);
if ($mname) {
$buttons = unserialize(variable_get('sharebar_buttons', sharebar_buttons_def()));
if (is_array($buttons) && count($buttons)) {
$button = $buttons[$mname];
}
}
$form['machine_name'] = array(
'#type' => 'value',
'#value' => $button->machine_name,
);
$form['#button'] = $button;
$form['type'] = array(
'#type' => 'value',
'#value' => 'button',
);
$form['name'] = array(
'#type' => 'value',
'#value' => $button->name,
);
$form['delete'] = array(
'#type' => 'value',
'#value' => TRUE,
);
return confirm_form($form, t('Are you sure you want to delete the button %title?', array(
'%title' => $button->name,
)), 'admin/config/sharebar/settings', t('This action cannot be undone.'), t('Delete'), t('Cancel'));
}