a88306c750db8a99f7e10753c02627526a258794
[yaffs-website] / web / core / modules / workflows / tests / modules / workflow_type_test / src / Form / ComplexTestTypeTransitionForm.php
1 <?php
2
3 namespace Drupal\workflow_type_test\Form;
4
5 use Drupal\Core\Form\FormStateInterface;
6 use Drupal\workflows\Plugin\WorkflowTypeTransitionFormBase;
7
8 /**
9  * Form to configure the complex test workflow states.
10  *
11  * @see \Drupal\workflow_type_test\Plugin\WorkflowType\ComplexTestType
12  */
13 class ComplexTestTypeTransitionForm extends WorkflowTypeTransitionFormBase {
14
15   /**
16    * {@inheritdoc}
17    */
18   public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
19     $transition = $form_state->get('transition');
20     $configuration = $this->workflowType->getConfiguration();
21     $form['extra'] = [
22       '#type' => 'textfield',
23       '#title' => $this->t('Extra'),
24       '#description' => $this->t('Extra information added to transition'),
25       '#default_value' => $transition && isset($configuration['transitions'][$transition->id()]['extra']) ? $configuration['transitions'][$transition->id()]['extra'] : '',
26     ];
27     return $form;
28   }
29
30 }