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