4 * Contains \Drupal\bootstrap\Plugin\Process\ManagedFile.
7 namespace Drupal\bootstrap\Plugin\Process;
9 use Drupal\bootstrap\Annotation\BootstrapProcess;
10 use Drupal\bootstrap\Utility\Element;
11 use Drupal\Core\Form\FormStateInterface;
14 * Processes the "managed_file" element.
16 * @ingroup plugins_process
18 * @BootstrapProcess("managed_file")
20 class ManagedFile extends ProcessBase implements ProcessInterface {
25 public static function processElement(Element $element, FormStateInterface $form_state, array &$complete_form) {
26 $ajax_wrapper_id = $element->upload_button->getProperty('ajax')['wrapper'];
27 if ($prefix = $element->getProperty('prefix')) {
28 $prefix = preg_replace('/<div id="' . $ajax_wrapper_id . '">/', '<div id="' . $ajax_wrapper_id . '" class="form-group">', $prefix);
29 $element->setProperty('prefix', $prefix);