diff --git a/public/app/themes/clarity/agency-switcher.php b/public/app/themes/clarity/agency-switcher.php index 2c6f946bd..a0c428d90 100644 --- a/public/app/themes/clarity/agency-switcher.php +++ b/public/app/themes/clarity/agency-switcher.php @@ -1,15 +1,33 @@ -
-

Choose your agency or body

-

Other agencies and bodies have their own specific intranet content available to view by visiting the links below. HMPPS and YJB links are external intranet websites not managed by this central MoJ intranet.

- -
+$oAgency = new Agency(); +$simpleHeader = !$oAgency->hasAgencyCookie(); +$heading = 'Choose your agency or body'; +$body = 'Other agencies and bodies have their own specific intranet content available to view by visiting the links +below. HMPPS and YJB links are external intranet websites not managed by this central MoJ intranet.'; + +// If we're using the simple header, assume a new user and change the intro text to reflect this +if ($simpleHeader) { + $heading = 'Welcome to the Ministry of Justice intranet'; + $body = 'Please choose your agency or body to access the intranet content specific to your organisation.'; +} +?> +
+

+ +

+

+ +

+ +
agencyExists($agency)) { - setcookie('dw_agency', $agency_default, $options); - $_COOKIE['dw_agency'] = $agency_default; + $slug = get_post_field('post_name'); + + if ( + // If the agency cookie isn't set or is set to an invalid agency + !$agencies->agencyExists($agency) && + // And the current page isn't the agency switcher, privacy notice, or accessibility page + !in_array($slug, ['agency-switcher', 'privacy-notice', 'accessibility'], true) && + // And the user isn't logged in + !is_user_logged_in() && + // And we're not in the admin area + $_SERVER['PHP_SELF'] != '/wp-admin/admin-ajax.php' + ) + { + // Redirect to the agency switcher page + wp_safe_redirect('/agency-switcher/'); + exit; } } }); diff --git a/public/app/themes/clarity/src/components/c-header-container/style.styl b/public/app/themes/clarity/src/components/c-header-container/style.styl index 7340b6578..d642b43ec 100644 --- a/public/app/themes/clarity/src/components/c-header-container/style.styl +++ b/public/app/themes/clarity/src/components/c-header-container/style.styl @@ -9,4 +9,8 @@ .c-header-container { margin-bottom: $spacing; + + &--underlined { + border-bottom: 10px solid $defaultAgencyColour; + } } diff --git a/public/app/themes/clarity/src/components/c-header-container/view.php b/public/app/themes/clarity/src/components/c-header-container/view.php index 64033d409..a4a8f6ad0 100644 --- a/public/app/themes/clarity/src/components/c-header-container/view.php +++ b/public/app/themes/clarity/src/components/c-header-container/view.php @@ -1,10 +1,24 @@ -