diff --git a/acquia_agent/acquia_agent.module b/acquia_agent/acquia_agent.module index cd2395ea07843b468e686c3011c73b79b067e6b7..1ea052ef2bae062a83a569018ebb92b595b55c97 100644 --- a/acquia_agent/acquia_agent.module +++ b/acquia_agent/acquia_agent.module @@ -213,19 +213,24 @@ function acquia_agent_init() { drupal_set_message($text, 'status', FALSE); } } +} - $request = ltrim(request_uri(), DIRECTORY_SEPARATOR); +/** + * Implementation of hook_page_build(). + */ +function acquia_agent_page_build(&$page) { $hide_signup_messages = variable_get('acquia_agent_hide_signup_messages', 0); - 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 epic set of dev features and tools that come with your free subscription.
If you have an Acquia Subscription, connect now. Otherwise, you can turn this message off by disabling the Acquia Subscription modules.'; + + // Display a signup message to administrators if the site isn't connected. + if (!$hide_signup_messages && user_access('administer site configuration') && !acquia_agent_has_credentials()) { + $message = ''; + $message .= t('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 epic set of dev features and tools that come with your free subscription.
', array('!acquia-free' => url('https://www.acquia.com/acquia-cloud-free'))); + $message .= t('If you have an Acquia subscription, connect now. Otherwise, you can turn this message off by disabling the Acquia Subscription modules.', array('!settings' => url('admin/config/system/acquia-agent/setup'))); + + // Use a shorter message for websites that are members of a site group. if (isset($_SERVER['AH_SITE_GROUP'])) { - $text = 'Connect your site to Acquia now. Learn more.'; + $message = t('Connect your site to the Acquia now. Learn more.', array('!settings' => url('admin/config/system/acquia-agent/setup'))); } - $message = t($text, array('!acquia-free' => url('https://www.acquia.com/acquia-cloud-free'), '!settings' => url('admin/config/system/acquia-agent/setup'))); drupal_set_message($message, 'warning', FALSE); } }