@@ -91,32 +91,58 @@ function fds_faxe_theme_preprocess_swiftmailer(&$variables) {
91
91
}
92
92
}
93
93
94
+ function fds_faxe_theme_preprocess_anonymous_subscriptions_notification_email(&$variables) {
95
+ global $base_url;
96
+ $language = \Drupal::languageManager()->getCurrentLanguage()->getId();
97
+ $theme = \Drupal::theme()->getActiveTheme();
98
+ $theme_path = $base_url . '/' . $theme->getPath();
99
+
100
+ // Theme settings.
101
+ $theme_settings = _fds_base_theme_collect_theme_settings();
102
+ $variables['current_language'] = $language;
103
+ $variables['base_url'] = $GLOBALS['base_url'] . '/';
104
+ $variables['logo_url'] = $theme_path . '/dist/images/logo--mail.png';
105
+ $variables['theme_settings'] = $theme_settings;
106
+
107
+ // Header logo.
108
+ if (!empty($theme_settings['language_logo']['header_logo__' . $language])) {
109
+ $file = File::load($theme_settings['language_logo']['header_logo__' . $language]);
110
+ if (!empty($file)) {
111
+ $variables['logo_url'] = file_create_url($file->getFileUri());
112
+ }
113
+ }
114
+ }
115
+
94
116
/**
95
117
* Implements hook_preprocess_HOOK().
96
118
*/
97
119
function fds_faxe_theme_preprocess_anonymous_subscriptions_message(array &$variables) {
98
-
99
120
global $base_url;
100
121
$language = \Drupal::languageManager()->getCurrentLanguage()->getId();
101
122
$theme = \Drupal::theme()->getActiveTheme();
102
123
$theme_path = $base_url . '/' . $theme->getPath();
103
- $variables['logo_url'] = $theme_path . '/dist/images/logo--mail.png';
124
+
125
+ // Theme settings.
126
+ $theme_settings = _fds_base_theme_collect_theme_settings();
127
+ $variables['current_language'] = $language;
104
128
$variables['base_url'] = $GLOBALS['base_url'] . '/';
129
+ $variables['logo_url'] = $theme_path . '/dist/images/logo--mail.png';
130
+ $variables['theme_settings'] = $theme_settings;
105
131
132
+ // Header logo.
106
133
if (!empty($theme_settings['language_logo']['header_logo__' . $language])) {
107
134
$file = File::load($theme_settings['language_logo']['header_logo__' . $language]);
108
135
if (!empty($file)) {
109
- $variables['logo_url'] = \Drupal::service('file_url_generator')->generateAbsoluteString ($file->getFileUri());
136
+ $variables['logo_url'] = file_create_url ($file->getFileUri());
110
137
}
111
138
}
112
-
113
139
$subscription = $variables['subscription'];
114
140
if (!empty($subscription->type->value) && $subscription->type->value == 'os2web_hearings_hearing_case') {
115
141
$variables['link'] = Link::fromTextAndUrl(t('Klik her for at gå til høringer og afgørelser'), Url::fromUserInput('/hoeringer-og-afgoerelser'));
116
142
}
143
+ }
117
144
118
145
119
- }
120
146
121
147
/**
122
148
* Implements hook_preprocess_term().
0 commit comments