function custompage_ui_delete_form_submit in Custom Page 6
Same name and namespace in other branches
- 7 custompage_ui/custompage_ui.module \custompage_ui_delete_form_submit()
File
- custompage_ui/
custompage_ui.module, line 209 - Custom Page Admin UI
Code
function custompage_ui_delete_form_submit($form, &$form_state) {
$key = $form_state['values']['key'];
$settings = variable_get('CUSTOMPAGE_UI_CONFIG', null);
if (is_array($settings) && is_object($settings[$key])) {
$new_settings = array_diff_key2($settings, array(
$key => 'remove',
));
}
variable_set('CUSTOMPAGE_UI_CONFIG', $new_settings);
drupal_flush_all_caches();
drupal_set_message(t('The custom page: %title has been deleted.', array(
'%title' => $form_state['values']['title'],
)));
$form_state['redirect'] = 'admin/build/custompage';
return;
}