function purge_form_button_callback in Purge 7.2
Simple form callback to redirect after a form button is clicked.
3 string references to 'purge_form_button_callback'
- OLDpurge_item_form in includes/
purge_ui.inc - Menu callback for purge item settins. @TODO REMOVE THIS. Die old functional code, die!.
- PurgePurgerBundleUI::get_form_action in includes/
purge_ui.class.inc - Generate the submit buttons.
- purge_item_action_form in includes/
purge_ui.inc - Form for simple yes/no operations on items.
File
- includes/
purge_ui.inc, line 700 - Provides administrative interface for the Purge module.
Code
function purge_form_button_callback($form, &$form_state) {
// Cancel button.
if ($form_state['clicked_button']['#name'] == 'cancel') {
// Redirect to main page.
$form_state['redirect'] = 'admin/config/system/purge';
}
elseif ($form_state['clicked_button']['#name'] == 'enable') {
$form_state['redirect'] = 'admin/config/system/purge/enable/' . $form_state['values']['item_type'] . '/' . $form_state['values']['machine_name'];
}
elseif ($form_state['clicked_button']['#name'] == 'disable') {
$form_state['redirect'] = 'admin/config/system/purge/disable/' . $form_state['values']['item_type'] . '/' . $form_state['values']['machine_name'];
}
elseif ($form_state['clicked_button']['#name'] == 'delete') {
$form_state['redirect'] = 'admin/config/system/purge/delete/' . $form_state['values']['item_type'] . '/' . $form_state['values']['machine_name'];
}
return $form;
}