function dba_check_tables_form in Database Administration 5
1 string reference to 'dba_check_tables_form'
- dba_admin_tables_check in ./dba.module
- MySQL only: check the selected table(s).
File
- ./dba.module, line 905
- Allows administrators direct access to their Drupal database.
Written by Jeremy Andrews <jeremy@kerneltrap.org>, June 2004.
PostgreSQL functionality provided by AAM <aam@ugpl.de>
Major security audit, porting, and maintenance by
Derek…
Code
function dba_check_tables_form() {
$form['check_tables']['tables']['#type'] = 'hidden';
$tables = dba_get_active_tables(0);
unset($_SESSION['dba_tables']);
if (!empty($tables)) {
$form['check_tables']['tables']['#default_value'] = implode(',', $tables);
}
else {
$form['check_tables'] = form_builder('dba_check_tables', $form['check_tables']);
if (!empty($form['check_tables']['tables']['#value'])) {
$form_tables = explode(',', $form['check_tables']['tables']['#value']);
$tables = dba_get_active_tables(0, $form_tables);
}
}
if (empty($tables)) {
drupal_set_message(t('You must select the tables to check.'), 'error');
drupal_goto('admin/build/database');
}
$form['check_options'] = array(
'#type' => 'fieldset',
'#title' => t('Actions'),
);
$form['check_options']['check_type'] = array(
'#type' => 'radios',
'#title' => t('Check type'),
'#default_value' => variable_get('dba_default_check_type', 'MEDIUM'),
'#options' => array(
'QUICK' => t('Quick'),
'FAST' => t('Fast'),
'CHANGED' => t('Changed'),
'MEDIUM' => t('Medium'),
'EXTENDED' => t('Extended'),
),
);
$form['check_options']['check'] = array(
'#type' => 'submit',
'#value' => t('Check again'),
);
$form['#pre_render'][] = 'dba_check_table_form_pre_render';
$form['#redirect'] = false;
return $form;
}