started to activate translations ajax nav

This commit is contained in:
Bachir Soussi Chiadmi
2018-04-13 19:23:02 +02:00
parent 0d555a596e
commit 10f68b951d
156 changed files with 21811 additions and 168 deletions
@@ -20,6 +20,7 @@ function edlp_ajax_page_attachments(array &$attachments) {
$redirect = false;
$current_path = \Drupal::service('path.current')->getPath();
$current_language = \Drupal::languageManager()->getCurrentLanguage()->getId();
$is_front = \Drupal::service('path.matcher')->isFrontPage();
// do not redirect if not node, term, or custom routing
@@ -33,10 +34,12 @@ function edlp_ajax_page_attachments(array &$attachments) {
$redirect = true;
}
// $redirect = false;
$js_str = "var edlp = {\n
sys_path:'".$current_path."',\n
is_front:".($is_front ? 'true':'false').",\n
redirect:".($redirect ? 'true':'false').",\n
lang_code:'".$current_language."',\n
};";
$attachments['#attached']['html_head'][] = [