ManagedFile.php in Open Social 8
Same filename and directory in other branches
- 8.9 themes/socialbase/src/Plugin/Process/ManagedFile.php
- 8.2 themes/socialbase/src/Plugin/Process/ManagedFile.php
- 8.3 themes/socialbase/src/Plugin/Process/ManagedFile.php
- 8.4 themes/socialbase/src/Plugin/Process/ManagedFile.php
- 8.5 themes/socialbase/src/Plugin/Process/ManagedFile.php
- 8.6 themes/socialbase/src/Plugin/Process/ManagedFile.php
- 8.7 themes/socialbase/src/Plugin/Process/ManagedFile.php
- 8.8 themes/socialbase/src/Plugin/Process/ManagedFile.php
Namespace
Drupal\socialbase\Plugin\ProcessFile
themes/socialbase/src/Plugin/Process/ManagedFile.phpView source
<?php
namespace Drupal\socialbase\Plugin\Process;
use Drupal\bootstrap\Utility\Element;
use Drupal\Core\Form\FormStateInterface;
use Drupal\bootstrap\Plugin\Process\ManagedFile as BaseManagedFile;
/**
* Processes the "managed_file" element.
*
* @ingroup plugins_process
*
* @BootstrapProcess("managed_file")
*/
class ManagedFile extends BaseManagedFile {
/**
* {@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 . '">', $prefix);
$element
->setProperty('prefix', $prefix);
}
}
}
Classes
Name | Description |
---|---|
ManagedFile | Processes the "managed_file" element. |