FileWidgetMultiple.php in Open Social 8.6
Same filename and directory in other branches
- 8.9 themes/socialbase/src/Plugin/Preprocess/FileWidgetMultiple.php
- 8 themes/socialbase/src/Plugin/Preprocess/FileWidgetMultiple.php
- 8.2 themes/socialbase/src/Plugin/Preprocess/FileWidgetMultiple.php
- 8.3 themes/socialbase/src/Plugin/Preprocess/FileWidgetMultiple.php
- 8.4 themes/socialbase/src/Plugin/Preprocess/FileWidgetMultiple.php
- 8.5 themes/socialbase/src/Plugin/Preprocess/FileWidgetMultiple.php
- 8.7 themes/socialbase/src/Plugin/Preprocess/FileWidgetMultiple.php
- 8.8 themes/socialbase/src/Plugin/Preprocess/FileWidgetMultiple.php
Namespace
Drupal\socialbase\Plugin\PreprocessFile
themes/socialbase/src/Plugin/Preprocess/FileWidgetMultiple.phpView source
<?php
namespace Drupal\socialbase\Plugin\Preprocess;
use Drupal\bootstrap\Plugin\Preprocess\PreprocessBase;
/**
* Pre-processes variables for the "file_widget_multiple" theme hook.
*
* @ingroup plugins_preprocess
*
* @BootstrapPreprocess("file_widget_multiple")
*/
class FileWidgetMultiple extends PreprocessBase {
/**
* {@inheritdoc}
*/
public function preprocess(array &$variables, $hook, array $info) {
parent::preprocess($variables, $hook, $info);
// Remove duplicated ajax wrapper for topic/events files field,
// because one is already rendered in container.html.twig.
if (!empty($variables['element']['#id']) && strpos($variables['element']['#id'], 'edit-field-files') !== FALSE) {
unset($variables['element']['#prefix']);
unset($variables['element']['#suffix']);
}
}
}
Classes
Name | Description |
---|---|
FileWidgetMultiple | Pre-processes variables for the "file_widget_multiple" theme hook. |