FieldDropdown.php in Open Social 8.6
Same filename and directory in other branches
- 8.9 themes/socialbase/src/Plugin/Preprocess/FieldDropdown.php
- 8 themes/socialbase/src/Plugin/Preprocess/FieldDropdown.php
- 8.2 themes/socialbase/src/Plugin/Preprocess/FieldDropdown.php
- 8.3 themes/socialbase/src/Plugin/Preprocess/FieldDropdown.php
- 8.4 themes/socialbase/src/Plugin/Preprocess/FieldDropdown.php
- 8.5 themes/socialbase/src/Plugin/Preprocess/FieldDropdown.php
- 8.7 themes/socialbase/src/Plugin/Preprocess/FieldDropdown.php
- 8.8 themes/socialbase/src/Plugin/Preprocess/FieldDropdown.php
Namespace
Drupal\socialbase\Plugin\PreprocessFile
themes/socialbase/src/Plugin/Preprocess/FieldDropdown.phpView source
<?php
namespace Drupal\socialbase\Plugin\Preprocess;
use Drupal\bootstrap\Plugin\Preprocess\PreprocessBase;
/**
* Pre-processes variables for the "dropdown" theme hook.
*
* @ingroup plugins_preprocess
*
* @BootstrapPreprocess("dropdown")
*/
class FieldDropdown extends PreprocessBase {
/**
* {@inheritdoc}
*/
public function preprocess(array &$variables, $hook, array $info) {
parent::preprocess($variables, $hook, $info);
if (isset($variables['active']) && is_numeric($variables['active'])) {
$title = $variables['element'][$variables['active']]['#title'];
$selected_icon = _socialbase_get_visibility_icon($title);
}
$variables['selected_icon'] = isset($selected_icon) ? $selected_icon : '';
}
}
Classes
Name | Description |
---|---|
FieldDropdown | Pre-processes variables for the "dropdown" theme hook. |