function ResolverRelationshipDelete::buildForm

Same name and namespace in other branches
  1. 8.x-3.x src/Form/ResolverRelationshipDelete.php \Drupal\ctools\Form\ResolverRelationshipDelete::buildForm()

Overrides ConfirmFormBase::buildForm

File

src/Form/ResolverRelationshipDelete.php, line 97

Class

ResolverRelationshipDelete
Resolver Relatinoship Delete Form.

Namespace

Drupal\ctools\Form

Code

public function buildForm(array $form, FormStateInterface $form_state, $id = NULL, $tempstore_id = NULL, $machine_name = NULL) {
  $this->tempstore_id = $tempstore_id;
  $this->machine_name = $machine_name;
  $this->id = $id;
  $cached_values = $this->tempstore
    ->get($this->tempstore_id)
    ->get($this->machine_name);
  $form['#title'] = $this->getQuestion($id, $cached_values);
  $form['#attributes']['class'][] = 'confirmation';
  $form['description'] = [
    '#markup' => $this->getDescription(),
  ];
  $form[$this->getFormName()] = [
    '#type' => 'hidden',
    '#value' => 1,
  ];
  // By default, render the form using theme_confirm_form().
  if (!isset($form['#theme'])) {
    $form['#theme'] = 'confirm_form';
  }
  $form['actions'] = [
    '#type' => 'actions',
  ];
  $form['actions'] += $this->actions($form, $form_state, $cached_values);
  return $form;
}