You are here

public function BackupDatabaseHistoryForm::buildForm in Backup Database 8

Form constructor.

Parameters

array $form: An associative array containing the structure of the form.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

Return value

array The form structure.

Overrides FormInterface::buildForm

File

src/Form/BackupDatabaseHistoryForm.php, line 28
Contains \Drupal\backup_db\Form\BackupDatabaseHistoryForm.

Class

BackupDatabaseHistoryForm
BackupDatabaseHistoryForm class.

Namespace

Drupal\backup_db\Form

Code

public function buildForm(array $form, FormStateInterface $form_state, $rows = array()) {
  $header = array(
    'fid' => 'fid',
    'name' => t('Name'),
    'location' => t('Location'),
    'created' => t('Created'),
  );
  $form['table'] = array(
    '#type' => 'tableselect',
    '#header' => $header,
    '#options' => $rows,
    '#empty' => t('No local export history found.'),
  );
  if ($rows) {
    $form['submit'] = array(
      '#type' => 'submit',
      '#value' => t('Delete'),
    );
  }
  return $form;
}