Skip to content

Instantly share code, notes, and snippets.

@Renrhaf
Created August 9, 2016 08:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Renrhaf/81adb41b7157e30b75e86bb09fdb7ecd to your computer and use it in GitHub Desktop.
Save Renrhaf/81adb41b7157e30b75e86bb09fdb7ecd to your computer and use it in GitHub Desktop.
AFOUND-810
From a2f0feb72b15f6146829d1eceba43af493b17093 Mon Sep 17 00:00:00 2001
From: Renrhaf <quentin.fahrner@actency.fr>
Date: Tue, 9 Aug 2016 10:11:25 +0200
Subject: [PATCH] AFOUND-810: fallback to FR header when in EN language
---
modules/custom/foundation_header/foundation_header.module | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/modules/custom/foundation_header/foundation_header.module b/modules/custom/foundation_header/foundation_header.module
index b64e2cf..c84c5b3 100755
--- a/modules/custom/foundation_header/foundation_header.module
+++ b/modules/custom/foundation_header/foundation_header.module
@@ -30,6 +30,13 @@ function foundation_header_page_build(&$page) {
global $language;
+ // In case we are requesting the english version of the header,
+ // which is not yet supported, fallback to french header version.
+ if ($language->language == 'en') {
+ $languages = language_list();
+ $language = $languages['fr'];
+ }
+
// Adding IE stuff for compatibility
drupal_add_js("window.hasOwnProperty('ActiveXObject') && document.write('<scr'+'ipt type=\"text/javascript\" src=\"" . variable_get('foundation_header_baseurl', 'https://www.arte.tv/components/src/') . "../public/ie-polyfill.js\"></sc'+'ript>');", 'inline');
drupal_add_js(variable_get('foundation_header_js', 'https://www.arte.tv/components/bundles/Header.min.js'), array(
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment