fixe sound direct link with mobile from desktop, fix #584

This commit is contained in:
2020-04-29 13:01:16 +02:00
parent 2eb05babe5
commit 67271fc277
8 changed files with 520 additions and 468 deletions
@@ -52,6 +52,8 @@ function edlp_mobile_help($route_name, RouteMatchInterface $route_match) {
/**
* Implements hook_page_attachments().
* the porpuse of this hooks is to collect registered domains informations to set it available to redirect.js file provided by edlptheme
* it does nothing by it's own
* @param array $attachments
*/
function edlp_mobile_page_attachments(array &$attachments) {
@@ -60,20 +62,19 @@ function edlp_mobile_page_attachments(array &$attachments) {
global $base_root;
// dpm($base_root, '$base_root');
// get the current hostname (domain)
$current_hostname = preg_replace('/http:\/\/|https:\/\//i', '', $base_root);
// dpm($current_hostname, '$current_hostname');
// get domains from domain module
$domain_storage = \Drupal::entityTypeManager()->getStorage('domain');
$mobile_domain = $domain_storage->load('m_encyclopediedelaparole_org');
// dpm($mobile_domain, 'mobile_domain');
$desktop_domain = $domain_storage->load('encyclopediedelaparole_org');
// dpm($desktop_domain, 'desktop_domain');
$expo_domain = $domain_storage->load('expo_encyclopediedelaparole_org');
// dpm($expo_domain, 'expo_domain');
// get the current domain
$current_domain = $domain_storage->loadByHostname($current_hostname);
// dpm($current_domain, 'current_domain');