ImageWidget.php in Open Social 8
Same filename and directory in other branches
- 8.9 themes/socialbase/src/Plugin/Preprocess/ImageWidget.php
- 8.2 themes/socialbase/src/Plugin/Preprocess/ImageWidget.php
- 8.3 themes/socialbase/src/Plugin/Preprocess/ImageWidget.php
- 8.4 themes/socialbase/src/Plugin/Preprocess/ImageWidget.php
- 8.5 themes/socialbase/src/Plugin/Preprocess/ImageWidget.php
- 8.6 themes/socialbase/src/Plugin/Preprocess/ImageWidget.php
- 8.7 themes/socialbase/src/Plugin/Preprocess/ImageWidget.php
- 8.8 themes/socialbase/src/Plugin/Preprocess/ImageWidget.php
Namespace
Drupal\socialbase\Plugin\PreprocessFile
themes/socialbase/src/Plugin/Preprocess/ImageWidget.phpView source
<?php
namespace Drupal\socialbase\Plugin\Preprocess;
use Drupal\bootstrap\Plugin\Preprocess\ImageWidget as BaseImageWidget;
use Drupal\bootstrap\Utility\Element;
use Drupal\bootstrap\Utility\Variables;
/**
* Pre-processes variables for the "image_widget" theme hook.
*
* @ingroup plugins_preprocess
*
* @see image-widget.html.twig
*
* @BootstrapPreprocess("image_widget",
* replace = "template_preprocess_image_widget"
* )
*/
class ImageWidget extends BaseImageWidget {
/**
* {@inheritdoc}
*/
public function preprocessElement(Element $element, Variables $variables) {
if (isset($variables['element']['#id']) && $variables['element']['#id'] == 'edit-field-post-image-0-upload') {
$variables['in_post'] = TRUE;
}
if (isset($variables['data']['remove_button'])) {
$variables['data']['remove_button']['#button_type'] = 'flat';
}
parent::preprocessElement($element, $variables);
}
}
Classes
Name | Description |
---|---|
ImageWidget | Pre-processes variables for the "image_widget" theme hook. |