From e26aedde5763e7c3995de12e262241fa2a10b146 Mon Sep 17 00:00:00 2001
From: Matthew Grasmick <matt.grasmick@gmail.com>
Date: Wed, 24 Feb 2021 12:52:05 -0500
Subject: [PATCH] Add a notice about D7 EOL.

---
 acquia_agent/acquia_agent.module | 24 ++++++++++++++++++------
 1 file changed, 18 insertions(+), 6 deletions(-)

diff --git a/acquia_agent/acquia_agent.module b/acquia_agent/acquia_agent.module
index a26d5e4..23860c1 100644
--- a/acquia_agent/acquia_agent.module
+++ b/acquia_agent/acquia_agent.module
@@ -203,13 +203,25 @@ function acquia_agent_init() {
   if (!$hide_signup_messages &&
     (arg(0) != 'overlay-ajax') && (arg(3) != 'acquia-agent') &&
     empty($_POST) &&  user_access('administer site configuration') &&
-    (!acquia_agent_has_credentials()) &&
-    (strpos($request, variable_get('file_public_path', conf_path() . DIRECTORY_SEPARATOR . 'files')) !== 0)) {
-    $text = 'Sign up for Acquia Cloud Free, a free Drupal sandbox to experiment with new features, test your code quality, and apply continuous integration best practices. Check out the <a href="!acquia-free">epic set of dev features and tools</a> that come with your free subscription.<br/>If you have an Acquia Subscription, <a href="!settings">connect now</a>. Otherwise, you can turn this message off by disabling the Acquia Subscription modules.';
-    if (isset($_SERVER['AH_SITE_GROUP'])) {
-      $text = '<a href="!settings">Connect your site to Acquia now</a>. <a href="!more">Learn more</a>.';
+    (strpos($request, variable_get('file_public_path', conf_path() . DIRECTORY_SEPARATOR . 'files')) !== 0)
+  ) {
+
+    if ((!acquia_agent_has_credentials())) {
+      $text = 'Sign up for Acquia Cloud Free, a free Drupal sandbox to experiment with new features, test your code quality, and apply continuous integration best practices. Check out the <a href="!acquia-free">epic set of dev features and tools</a> that come with your free subscription.<br/>If you have an Acquia Subscription, <a href="!settings">connect now</a>. Otherwise, you can turn this message off by disabling the Acquia Subscription modules.';
+      if (isset($_SERVER['AH_SITE_GROUP'])) {
+        $text = '<a href="!settings">Connect your site to Acquia now</a>. <a href="!more">Learn more</a>.';
+      }
+      $message = t($text, [
+        '!more' => url('https://www.acquia.com/acquia-cloud-free'),
+        '!settings' => url('admin/config/system/acquia-agent/setup')
+      ]);
+      drupal_set_message($message, 'warning', FALSE);
     }
-    $message = t($text, array('!acquia-free' => url('https://www.acquia.com/acquia-cloud-free'), '!settings' => url('admin/config/system/acquia-agent/setup')));
+
+    $text = '<a href="!settings">Drupal 7 will reach end of life in November 2022</a>. <a href="!more">Learn more</a>.';
+    $message = t($text, [
+      '!more' => url('https://dev.acquia.com/d7-eol'),
+    ]);
     drupal_set_message($message, 'warning', FALSE);
   }
 }
-- 
2.12.2

