示例#1
0
 /**
  * {@inheritdoc}
  */
 public function buildForm(array $form, FormStateInterface $form_state)
 {
     $config = $this->config('embed.settings');
     $scheme_options = $this->streamWrapperManager->getNames(StreamWrapperInterface::WRITE_VISIBLE);
     $form['file_scheme'] = ['#type' => 'radios', '#title' => $this->t('Upload destination'), '#options' => $scheme_options, '#default_value' => $config->get('file_scheme'), '#description' => $this->t('Select where the uploaded button icon files should be stored.')];
     $form['upload_directory'] = ['#type' => 'textfield', '#title' => $this->t('File directory'), '#default_value' => $config->get('upload_directory'), '#description' => $this->t('Optional subdirectory within the upload destination where files will be stored. Do not include preceding or trailing slashes.'), '#element_validate' => [[get_class($this), 'validateDirectory']]];
     return parent::buildForm($form, $form_state);
 }