You are here

function acquia_agent_page_build in Acquia Connector 7.2

Implementation of hook_page_build().

File

acquia_agent/acquia_agent.module, line 221
Acquia Agent securely sends information to Acquia Insight.

Code

function acquia_agent_page_build(&$page) {
  $hide_signup_messages = variable_get('acquia_agent_hide_signup_messages', 0);

  // Display a signup message to administrators if the site isn't connected to
  // the Acquia Network.
  if (!$hide_signup_messages && arg(3) != 'acquia-agent' && 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 <a href="!acquia-free">epic set of dev features and tools</a> that come with your free subscription.<br/>', array(
      '!acquia-free' => url('https://www.acquia.com/acquia-cloud-free'),
    ));
    $message .= t('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.', array(
      '!settings' => url('admin/config/system/acquia-agent/setup'),
    ));
    if (isset($_SERVER['AH_SITE_GROUP'])) {
      $message .= t('<a href="!settings">Connect your site to Acquia now</a>. <a href="!more">Learn more</a>.', array(
        '!settings' => url('admin/config/system/acquia-agent/setup'),
      ));
    }
    drupal_set_message($message, 'warning', FALSE);
  }
}