You are here

public function AcquiaLiftAgent::getAssets in Acquia Lift Connector 7

Implements PersonalizeAgentInterface::getAssets().

File

plugins/agent_types/AcquiaLiftAgent.inc, line 237
Provides an agent type for Acquia Lift

Class

AcquiaLiftAgent

Code

public function getAssets() {
  $path = drupal_get_path('module', 'acquia_lift');
  return array(
    'js' => array(
      array(
        'type' => 'setting',
        'data' => array(
          'acquia_lift' => array(
            'apiKey' => $this->liftAPI
              ->getApiKey(),
            'owner' => $this->liftAPI
              ->getOwnerCode(),
            'baseUrl' => $this->liftAPI
              ->getApiUrl(),
            'featureStringReplacePattern' => AcquiaLiftAPI::FEATURE_STRING_REPLACE_PATTERN,
            'featureStringMaxLength' => AcquiaLiftAPI::FEATURE_STRING_MAX_LENGTH,
            // @todo Add support for mutually exclusive values.
            'featureStringSeparator' => AcquiaLiftAPI::FEATURE_STRING_SEPARATOR_NONMUTEX,
            'batchMode' => variable_get('acquia_lift_batch_decisions', FALSE),
          ),
        ),
      ),
      // Add the Acquia Lift API js wrapper and the Acquia Lift integration js.
      $path . '/js/acquia_lift.js' => array(
        'type' => 'file',
        'scope' => 'footer',
        'defer' => TRUE,
      ),
    ),
    'library' => array(
      array(
        'acquia_lift',
        'acquia_lift.agent_api',
      ),
    ),
  );
}