Container.php in Open Social 8.3
File
themes/socialbase/src/Plugin/Preprocess/Container.php
View source
<?php
namespace Drupal\socialbase\Plugin\Preprocess;
use Drupal\bootstrap\Plugin\Preprocess\PreprocessBase;
use Symfony\Cmf\Component\Routing\RouteObjectInterface;
class Container extends PreprocessBase {
public function preprocess(array &$variables, $hook, array $info) {
parent::preprocess($variables, $hook, $info);
$routename = \Drupal::request()
->get(RouteObjectInterface::ROUTE_NAME);
if (strpos($routename, 'search') !== FALSE) {
if (!isset($variables['element']['#exposed_form'])) {
$variables['bare'] = TRUE;
}
}
if (isset($variables['element']['#id']) && $variables['element']['#id'] == 'edit-field-comment-files-wrapper') {
$variables['bare'] = TRUE;
}
if (isset($variables['element']['#inline'])) {
$variables['bare'] = TRUE;
}
if (isset($variables['element']['#type']) && $variables['element']['#type'] == 'view') {
$variables['bare'] = TRUE;
}
if (isset($variables['element']['#addsearchicon'])) {
$variables['bare'] = TRUE;
}
if (isset($variables['element']['#exposed_form'])) {
$variables['exposed_form'] = TRUE;
}
}
}
Classes
Name |
Description |
Container |
Pre-processes variables for the "container" theme hook. |