You are here

function dba_run_script in Database Administration 5

1 string reference to 'dba_run_script'
dba_menu in ./dba.module

File

./dba.module, line 841
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_run_script() {
  if (user_access('dba administer database')) {
    $form['script'] = array(
      '#type' => 'fieldset',
      '#title' => 'Script',
    );
    $form['script']['script_filename'] = array(
      '#type' => 'file',
      '#title' => t('Select a script'),
      '#description' => t('Click the "browse" button to select a database script from your local computer.'),
    );
    $form['script']['verbose'] = array(
      '#type' => 'checkbox',
      '#title' => t('Verbose'),
      '#return_value' => 1,
      '#default_value' => 0,
      '#description' => t('Check this box if you wish to see all queries that are run.'),
    );
    $form['script']['submit'] = array(
      '#type' => 'submit',
      '#value' => t('Run script'),
    );
    $form['#attributes'] = array(
      'enctype' => 'multipart/form-data',
    );
  }
  return $form;
}