You are here

function acquia_agent_init in Acquia Connector 6

Same name and namespace in other branches
  1. 6.2 acquia_agent/acquia_agent.module \acquia_agent_init()
  2. 7.3 acquia_agent/acquia_agent.module \acquia_agent_init()
  3. 7 acquia_agent/acquia_agent.module \acquia_agent_init()
  4. 7.2 acquia_agent/acquia_agent.module \acquia_agent_init()

Implementation of hook_init().

File

acquia_agent/acquia_agent.module, line 50
Acquia Agent securely sends information to Acquia Network.

Code

function acquia_agent_init() {
  if (arg(2) != 'acquia-agent' && empty($_POST) && user_access('administer site configuration') && !acquia_agent_has_credentials()) {
    $message = t('Get a <a href="@acquia-free">free 30 day trial</a> of Drupal support, enhanced content search, comment spam blocking and more. If you have an Acquia Network subscription, <a href="@settings">connect now</a>.', array(
      '@acquia-free' => url('admin/settings/acquia-agent'),
      '@settings' => url('admin/settings/acquia-agent/connection'),
    ));
    if (arg(0) == 'admin') {
      $message .= '<br />' . t('To turn this message off, disable the Acquia Network Connector <a href="@admin-modules">modules</a>.', array(
        '@admin-modules' => url('admin/build/modules', array(
          'fragment' => 'system-modules',
        )),
      ));
    }
    drupal_set_message($message, 'warning', FALSE);
  }
}