Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects

OEL-1307: Update oe_whitelabel to BCL 0.20.0

Merged Francesco SARDARA requested to merge OEL-1307 into 1.x
8 files
+ 25
117
Compare changes
  • Side-by-side
  • Inline
Files
8
@@ -8,6 +8,7 @@
declare(strict_types = 1);
use Drupal\Component\Utility\Html;
use Drupal\oe_whitelabel_helper\EuropeanUnionLanguages;
/**
* Implements hook_preprocess_links().
@@ -70,6 +71,10 @@ function oe_whitelabel_multilingual_preprocess_links__oe_multilingual_content_la
function oe_whitelabel_multilingual_preprocess_links__language_block(&$variables) {
$currentLanguage = \Drupal::languageManager()->getCurrentLanguage();
$current_language_id = $currentLanguage->getId();
$language_internal = $current_language_id;
if (EuropeanUnionLanguages::hasLanguage($current_language_id)) {
$language_internal = EuropeanUnionLanguages::getInternalLanguageCode($current_language_id);
}
$language_config_storage = \Drupal::entityTypeManager()->getStorage('configurable_language');
$eu_links = [];
$non_eu_links = [];
@@ -84,10 +89,11 @@ function oe_whitelabel_multilingual_preprocess_links__language_block(&$variables
$label = $link['link']['#title'];
$link = [
'href' => $href,
'path' => $href,
'name' => $label,
'id' => 'link_' . $language_code,
'hreflang' => $language_code,
'label' => $label,
'lang' => $language_internal,
];
if (!empty($current_language_id) && $language_code === $current_language_id) {
@@ -107,17 +113,14 @@ function oe_whitelabel_multilingual_preprocess_links__language_block(&$variables
}
}
$variables['language']['modal'] = [
$variables['language']['modal']['language_list'] = [
'overlay' => TRUE,
'variant' => $variables['bcl_component_library'],
'title' => t('Select your language'),
'items' => $eu_links,
'non_eu_items' => $non_eu_links,
'icon_path' => $variables['bcl_icon_path'],
'id' => 'languageModal',
'size' => 'fullscreen',
'header' => [
'title' => t('Select your language'),
'label' => t('Close'),
],
'eu_links' => $eu_links,
'non_eu_links' => $non_eu_links,
'footer' => [
'label' => t('Close'),
],
];
}
Loading