WebformVariantEditForm.php in Webform 6.x
File
src/Form/WebformVariantEditForm.php
View source
<?php
namespace Drupal\webform\Form;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Url;
use Drupal\webform\WebformInterface;
class WebformVariantEditForm extends WebformVariantFormBase {
public function buildForm(array $form, FormStateInterface $form_state, WebformInterface $webform = NULL, $webform_variant = NULL) {
$form = parent::buildForm($form, $form_state, $webform, $webform_variant);
$form['#title'] = $this
->t('Edit @label variant', [
'@label' => $this->webformVariant
->label(),
]);
$url = new Url('entity.webform.variant.delete_form', [
'webform' => $webform
->id(),
'webform_variant' => $this->webformVariant
->getVariantId(),
]);
$this
->buildDialogDeleteAction($form, $form_state, $url);
return $form;
}
protected function prepareWebformVariant($webform_variant) {
return $this->webform
->getVariant($webform_variant);
}
}