express-8.x-1.x-dev/themes/contrib/bootstrap/src/Plugin/Process/ManagedFile.php
themes/contrib/bootstrap/src/Plugin/Process/ManagedFile.php
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | <?php /** * @file * Contains \Drupal\bootstrap\Plugin\Process\ManagedFile. */ namespace Drupal\bootstrap\Plugin\Process; use Drupal\bootstrap\Annotation\BootstrapProcess; use Drupal\bootstrap\Utility\Element; use Drupal\Core\Form\FormStateInterface; /** * Processes the "managed_file" element. * * @ingroup plugins_process * * @BootstrapProcess("managed_file") */ class ManagedFile extends ProcessBase implements ProcessInterface { /** * {@inheritdoc} */ public static function processElement(Element $element , FormStateInterface $form_state , array & $complete_form ) { $ajax_wrapper_id = $element ->upload_button->getProperty( 'ajax' )[ 'wrapper' ]; if ( $prefix = $element ->getProperty( 'prefix' )) { $prefix = preg_replace( '/<div id="' . $ajax_wrapper_id . '">/' , '<div id="' . $ajax_wrapper_id . '" class="form-group">' , $prefix ); $element ->setProperty( 'prefix' , $prefix ); } } } |