Skip to content
Snippets Groups Projects
Commit 46493481 authored by Chris Shantz's avatar Chris Shantz
Browse files

Merge branch 'feature/EXPHR-kpaxman-global_message_timeout' into '1.1.x'

Feature/exphr kpaxman global message timeout

See merge request !127
parents b81c420c eadf1b6d
No related branches found
No related tags found
1 merge request!127Feature/exphr kpaxman global message timeout
...@@ -207,8 +207,17 @@ function uw_fdsu_theme_resp_preprocess_region(&$variables) { ...@@ -207,8 +207,17 @@ function uw_fdsu_theme_resp_preprocess_region(&$variables) {
$variables['faculty'] = theme_get_setting('wcms_colour_scheme', 'uw_fdsu_theme_resp') ? theme_get_setting('wcms_colour_scheme', 'uw_fdsu_theme_resp') : 'org-default'; $variables['faculty'] = theme_get_setting('wcms_colour_scheme', 'uw_fdsu_theme_resp') ? theme_get_setting('wcms_colour_scheme', 'uw_fdsu_theme_resp') : 'org-default';
// Create the stream context to use with file_get_contents
// so it times out after a certain period instead of
// waiting indefinitely. Timeout is in seconds.
$context = stream_context_create([
'http' => [
'timeout' => 3,
],
]);
// Global message content. // Global message content.
$global_message = file_get_contents('https://uwaterloo.ca/global-message.html'); $global_message = file_get_contents('https://uwaterloo.ca/global-message.html', 0, $context);
// If there is something to display, make sure to include css file, and // If there is something to display, make sure to include css file, and
// pass message as render array, then use render twig filter to avoid using // pass message as render array, then use render twig filter to avoid using
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment