function performance_clear_form in Performance Logging and Monitoring 7.2
Same name and namespace in other branches
- 6.2 performance.module \performance_clear_form()
- 6 performance.module \performance_clear_form()
- 7 performance.module \performance_clear_form()
Clear logs form.
1 string reference to 'performance_clear_form'
- performance_menu in ./
performance.module - Implements hook_menu().
File
- ./
performance.module, line 670 - Logs detailed and/or summary page generation time and memory consumption for page requests. Copyright Khalid Baheyeldin 2008 of http://2bits.com
Code
function performance_clear_form($form, &$form_state, $store = NULL) {
$base = 'admin/reports/performance-logging/';
// Seemed the best solution, instead of doing something like
// t('Are you sure you want to clear all @store data?', array ('@store' => $store));
switch ($store) {
case 'summary':
$question = t('Are you sure you want to clear all summary data?');
$path = $base . 'summary';
break;
case 'details':
$question = t('Are you sure you want to clear all detail data?');
$path = $base . 'details';
break;
default:
// None or unrecognised store => 404.
drupal_not_found();
return 2;
}
$form['store'] = array(
'#type' => 'value',
'#value' => $store,
);
$form['redirect'] = array(
'#type' => 'value',
'#value' => $path,
);
return confirm_form($form, $question, $path);
}