3 namespace Drupal\bootstrap\Plugin\Process;
5 use Drupal\bootstrap\Utility\Element;
6 use Drupal\Core\Form\FormStateInterface;
9 * Processes the "managed_file" element.
11 * @ingroup plugins_process
13 * @BootstrapProcess("managed_file")
15 class ManagedFile extends ProcessBase implements ProcessInterface {
20 public static function processElement(Element $element, FormStateInterface $form_state, array &$complete_form) {
21 $ajax_wrapper_id = $element->upload_button->getProperty('ajax')['wrapper'];
22 if ($prefix = $element->getProperty('prefix')) {
23 $prefix = preg_replace('/<div id="' . $ajax_wrapper_id . '">/', '<div id="' . $ajax_wrapper_id . '" class="form-group">', $prefix);
24 $element->setProperty('prefix', $prefix);