{"action":"created","comment":{"url":"https://api.github.com/repos/acquia/acquia_lift/pulls/comments/88882489","pull_request_review_id":9440441,"id":88882489,"diff_hunk":"@@ -0,0 +1,262 @@\n+<?php\n+\n+/**\n+ * @file acquia_lift.module\n+ * Provides Acquia Lift Profiles integration.\n+ */\n+\n+define('ACQUIA_LIFT_THUMBNAIL_WIDGET_SEPARATOR', '|');\n+define('ACQUIA_LIFT_DEFAULT_IDENTITY_TYPE_DEFAULT', 'email');\n+define('ACQUIA_LIFT_DEFAULT_IDENTITY_TYPE_IDENTIFIER', 'account');\n+define('ACQUIA_LIFT_ENGAGEMENT_SCORE_DEFAULT', 1);\n+define('ACQUIA_LIFT_GLOBAL_VALUE_DEFAULT', 1);\n+define('ACQUIA_LIFT_ADMIN_SEPARATOR', '__');\n+\n+/**\n+ * Implements hook_menu().\n+ */\n+function acquia_lift_menu() {\n+  $items = array();\n+  $items['admin/config/services/acquia_lift'] = array(\n+    'type' => MENU_NORMAL_ITEM,\n+    'title' => 'Acquia Lift',\n+    'description' => 'Configuration settings for the Acquia Lift integration module.',\n+    'page callback' => 'drupal_get_form',\n+    'page arguments' => array('acquia_lift_admin_form'),\n+    'access arguments' => array('administer acquia_lift configuration'),\n+    'file' => 'acquia_lift.admin.inc'\n+  );\n+  return $items;\n+}\n+\n+/**\n+ * Implements hook_permission().\n+ */\n+function acquia_lift_permission() {\n+  $permissions = array(\n+    'administer acquia_lift configuration' => array(\n+      'title' => t('Administer acquia_lift settings'),\n+      'description' => t('Administer configuration settings for Acquia Lift.'),\n+    ),\n+  );\n+  return $permissions;\n+}\n+\n+/**\n+ * Implements hook_help().\n+ */\n+function acquia_lift_help($path, $arg) {\n+  switch ($path) {\n+    case 'admin/help#acquia_lift':\n+      $output = '<h3>' . t('About') . '</h3>';\n+      $output .= '<p>' . t('The Acquia Lift module provides machine-learning-based personalization for Drupal sites.') . '</p>';\n+      $output .= '<h3>' . t('Configuration') . '</h3>';\n+      $output .= '<p>' . t('Go to the !configlink to configure your Acquia Lift credentials.', array('!configlink' => l(t('configuration settings page'), 'admin/config/services/acquia_lift'))) . '</p>';\n+      $output .= '<p>' . t('You can find more info in <a href=\"@lift-documentation\" target=\"_blank\">Documentation</a>.', array(\n+          '@lift-documentation' => 'https://docs.acquia.com/lift'\n+        ));\n+      return $output;\n+  }\n+}\n+\n+/**\n+ * Returns whether or not Acquia Lift has been configured.\n+ *\n+ * @return bool\n+ *   TRUE if all relevant configuration settings have been set, FALSE\n+ *   otherwise.\n+ */\n+function acquia_lift_is_configured() {\n+  foreach (array('acquia_lift_account_id','acquia_lift_site_id', 'acquia_lift_assets_url') as $api_config) {\n+    $val = variable_get($api_config, '');\n+    if (empty($val)) {\n+      return FALSE;\n+    }\n+  }\n+  return TRUE;\n+}\n+\n+/**\n+ * Implements hook_page_build().\n+ */\n+function acquia_lift_page_build(&$page) {\n+  // Bail if Acquia Lift has not yet been configured.\n+  if (!acquia_lift_is_configured()) {\n+    return;\n+  }\n+\n+  // Bail if the path is a path to ignore\n+  $current_path = '/' . current_path();\n+  $alias_path = drupal_lookup_path('alias', current_path());\n+  $alias_path = $alias_path == FALSE ? $current_path : '/' . $alias_path;\n+  $patterns = variable_get('acquia_lift_ignore_path_patterns', '');\n+  if (drupal_match_path($current_path, $patterns) || drupal_match_path($alias_path, $patterns)) {\n+    return;\n+  }\n+\n+  $assets_url = variable_get('acquia_lift_assets_url');\n+  $decision_api_url = variable_get('acquia_lift_decision_api_url', '');\n+  $oauth_url = variable_get('acquia_lift_oauth_url', '');\n+\n+  // Add the credentials and configuration for the Lift Experience Builder.\n+  _acquia_lift_add_meta_tag('account_id', variable_get('acquia_lift_account_id'));\n+  _acquia_lift_add_meta_tag('site_id', variable_get('acquia_lift_site_id'));\n+  _acquia_lift_add_meta_tag('liftAssetsUrl', $assets_url);\n+  if (!empty($decision_api_url)) {\n+    _acquia_lift_add_meta_tag('liftDecisionAPIURL', variable_get('acquia_lift_decision_api_url'));\n+  }\n+  if (!empty($oauth_url)) {\n+    _acquia_lift_add_meta_tag('authEndpoint', variable_get('acquia_lift_oauth_url'));\n+  }\n+  _acquia_lift_add_meta_tag('contentReplacementMode', variable_get('acquia_lift_content_replacement_mode', 'untrusted'));\n+\n+  // If there are querystring parameters present corresponding to the configured\n+  // identity params, we add the identity and identity type to the meta tags.\n+  $identity_param = variable_get('acquia_lift_identity_param', '');\n+  $identity_type_param = variable_get('acquia_lift_identity_type_param', '');\n+  if (!empty($identity_param)) {\n+    $all_params = drupal_get_query_parameters();\n+    if (isset($all_params[$identity_param])) {\n+      // Set the identity type to the default either as specified by the user or\n+      // as the application default.\n+      $identity_type = variable_get('acquia_lift_default_identity_type') ?: ACQUIA_LIFT_DEFAULT_IDENTITY_TYPE_DEFAULT;\n+      if (!empty($identity_type_param) && isset($all_params[$identity_type_param])) {","path":"acquia_lift.module","position":null,"original_position":123,"commit_id":"8d35ed293af336a521d15ba95e8f745b366f8d82","original_commit_id":"5b033fefa21c6b0315ad6c096c232b84c44f72fc","user":{"login":"eshtadc","id":3512988,"avatar_url":"https://avatars.githubusercontent.com/u/3512988?v=3","gravatar_id":"","url":"https://api.github.com/users/eshtadc","html_url":"https://github.com/eshtadc","followers_url":"https://api.github.com/users/eshtadc/followers","following_url":"https://api.github.com/users/eshtadc/following{/other_user}","gists_url":"https://api.github.com/users/eshtadc/gists{/gist_id}","starred_url":"https://api.github.com/users/eshtadc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eshtadc/subscriptions","organizations_url":"https://api.github.com/users/eshtadc/orgs","repos_url":"https://api.github.com/users/eshtadc/repos","events_url":"https://api.github.com/users/eshtadc/events{/privacy}","received_events_url":"https://api.github.com/users/eshtadc/received_events","type":"User","site_admin":false},"body":"https://github.com/acquia/acquia_lift/pull/245/commits/8d35ed293af336a521d15ba95e8f745b366f8d82","created_at":"2016-11-21T12:15:22Z","updated_at":"2016-11-21T12:15:22Z","html_url":"https://github.com/acquia/acquia_lift/pull/245#discussion_r88882489","pull_request_url":"https://api.github.com/repos/acquia/acquia_lift/pulls/245","_links":{"self":{"href":"https://api.github.com/repos/acquia/acquia_lift/pulls/comments/88882489"},"html":{"href":"https://github.com/acquia/acquia_lift/pull/245#discussion_r88882489"},"pull_request":{"href":"https://api.github.com/repos/acquia/acquia_lift/pulls/245"}}},"pull_request":{"url":"https://api.github.com/repos/acquia/acquia_lift/pulls/245","id":93848622,"html_url":"https://github.com/acquia/acquia_lift/pull/245","diff_url":"https://github.com/acquia/acquia_lift/pull/245.diff","patch_url":"https://github.com/acquia/acquia_lift/pull/245.patch","issue_url":"https://api.github.com/repos/acquia/acquia_lift/issues/245","number":245,"state":"open","locked":false,"title":"CHMS-1012: Initial Drupal 7 offering for Lift 3","user":{"login":"eshtadc","id":3512988,"avatar_url":"https://avatars.githubusercontent.com/u/3512988?v=3","gravatar_id":"","url":"https://api.github.com/users/eshtadc","html_url":"https://github.com/eshtadc","followers_url":"https://api.github.com/users/eshtadc/followers","following_url":"https://api.github.com/users/eshtadc/following{/other_user}","gists_url":"https://api.github.com/users/eshtadc/gists{/gist_id}","starred_url":"https://api.github.com/users/eshtadc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eshtadc/subscriptions","organizations_url":"https://api.github.com/users/eshtadc/orgs","repos_url":"https://api.github.com/users/eshtadc/repos","events_url":"https://api.github.com/users/eshtadc/events{/privacy}","received_events_url":"https://api.github.com/users/eshtadc/received_events","type":"User","site_admin":false},"body":"The ultimate goal is feature parity with Drupal 8 module. This would become branch 7.x-3.x of the module. At this time it includes:\r\n* Ability to set identity parameters\r\n* Ability to map taxonomies\r\n* Ability to map UDF (user defined) fields\r\n* Configuration of Lift endpoints\r\n* Rendering of values into meta tags similar to D8 rather than the drupalSettings settings\r\n","created_at":"2016-11-15T21:09:54Z","updated_at":"2016-11-21T12:15:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f0fed1cb11ee8f5a20247ca300154ffdbcfac092","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/acquia/acquia_lift/pulls/245/commits","review_comments_url":"https://api.github.com/repos/acquia/acquia_lift/pulls/245/comments","review_comment_url":"https://api.github.com/repos/acquia/acquia_lift/pulls/comments{/number}","comments_url":"https://api.github.com/repos/acquia/acquia_lift/issues/245/comments","statuses_url":"https://api.github.com/repos/acquia/acquia_lift/statuses/8d35ed293af336a521d15ba95e8f745b366f8d82","head":{"label":"acquia:CHMS-1012","ref":"CHMS-1012","sha":"8d35ed293af336a521d15ba95e8f745b366f8d82","user":{"login":"acquia","id":514789,"avatar_url":"https://avatars.githubusercontent.com/u/514789?v=3","gravatar_id":"","url":"https://api.github.com/users/acquia","html_url":"https://github.com/acquia","followers_url":"https://api.github.com/users/acquia/followers","following_url":"https://api.github.com/users/acquia/following{/other_user}","gists_url":"https://api.github.com/users/acquia/gists{/gist_id}","starred_url":"https://api.github.com/users/acquia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/acquia/subscriptions","organizations_url":"https://api.github.com/users/acquia/orgs","repos_url":"https://api.github.com/users/acquia/repos","events_url":"https://api.github.com/users/acquia/events{/privacy}","received_events_url":"https://api.github.com/users/acquia/received_events","type":"Organization","site_admin":false},"repo":{"id":17344049,"name":"acquia_lift","full_name":"acquia/acquia_lift","owner":{"login":"acquia","id":514789,"avatar_url":"https://avatars.githubusercontent.com/u/514789?v=3","gravatar_id":"","url":"https://api.github.com/users/acquia","html_url":"https://github.com/acquia","followers_url":"https://api.github.com/users/acquia/followers","following_url":"https://api.github.com/users/acquia/following{/other_user}","gists_url":"https://api.github.com/users/acquia/gists{/gist_id}","starred_url":"https://api.github.com/users/acquia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/acquia/subscriptions","organizations_url":"https://api.github.com/users/acquia/orgs","repos_url":"https://api.github.com/users/acquia/repos","events_url":"https://api.github.com/users/acquia/events{/privacy}","received_events_url":"https://api.github.com/users/acquia/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/acquia/acquia_lift","description":"Mirror of the drupal.org repository for Acquia Lift module","fork":false,"url":"https://api.github.com/repos/acquia/acquia_lift","forks_url":"https://api.github.com/repos/acquia/acquia_lift/forks","keys_url":"https://api.github.com/repos/acquia/acquia_lift/keys{/key_id}","collaborators_url":"https://api.github.com/repos/acquia/acquia_lift/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/acquia/acquia_lift/teams","hooks_url":"https://api.github.com/repos/acquia/acquia_lift/hooks","issue_events_url":"https://api.github.com/repos/acquia/acquia_lift/issues/events{/number}","events_url":"https://api.github.com/repos/acquia/acquia_lift/events","assignees_url":"https://api.github.com/repos/acquia/acquia_lift/assignees{/user}","branches_url":"https://api.github.com/repos/acquia/acquia_lift/branches{/branch}","tags_url":"https://api.github.com/repos/acquia/acquia_lift/tags","blobs_url":"https://api.github.com/repos/acquia/acquia_lift/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/acquia/acquia_lift/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/acquia/acquia_lift/git/refs{/sha}","trees_url":"https://api.github.com/repos/acquia/acquia_lift/git/trees{/sha}","statuses_url":"https://api.github.com/repos/acquia/acquia_lift/statuses/{sha}","languages_url":"https://api.github.com/repos/acquia/acquia_lift/languages","stargazers_url":"https://api.github.com/repos/acquia/acquia_lift/stargazers","contributors_url":"https://api.github.com/repos/acquia/acquia_lift/contributors","subscribers_url":"https://api.github.com/repos/acquia/acquia_lift/subscribers","subscription_url":"https://api.github.com/repos/acquia/acquia_lift/subscription","commits_url":"https://api.github.com/repos/acquia/acquia_lift/commits{/sha}","git_commits_url":"https://api.github.com/repos/acquia/acquia_lift/git/commits{/sha}","comments_url":"https://api.github.com/repos/acquia/acquia_lift/comments{/number}","issue_comment_url":"https://api.github.com/repos/acquia/acquia_lift/issues/comments{/number}","contents_url":"https://api.github.com/repos/acquia/acquia_lift/contents/{+path}","compare_url":"https://api.github.com/repos/acquia/acquia_lift/compare/{base}...{head}","merges_url":"https://api.github.com/repos/acquia/acquia_lift/merges","archive_url":"https://api.github.com/repos/acquia/acquia_lift/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/acquia/acquia_lift/downloads","issues_url":"https://api.github.com/repos/acquia/acquia_lift/issues{/number}","pulls_url":"https://api.github.com/repos/acquia/acquia_lift/pulls{/number}","milestones_url":"https://api.github.com/repos/acquia/acquia_lift/milestones{/number}","notifications_url":"https://api.github.com/repos/acquia/acquia_lift/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/acquia/acquia_lift/labels{/name}","releases_url":"https://api.github.com/repos/acquia/acquia_lift/releases{/id}","deployments_url":"https://api.github.com/repos/acquia/acquia_lift/deployments","created_at":"2014-03-02T18:42:14Z","updated_at":"2014-08-25T15:09:47Z","pushed_at":"2016-11-21T12:15:10Z","git_url":"git://github.com/acquia/acquia_lift.git","ssh_url":"git@github.com:acquia/acquia_lift.git","clone_url":"https://github.com/acquia/acquia_lift.git","svn_url":"https://github.com/acquia/acquia_lift","homepage":"","size":7954,"stargazers_count":2,"watchers_count":2,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":12,"mirror_url":null,"open_issues_count":4,"forks":12,"open_issues":4,"watchers":2,"default_branch":"master"}},"base":{"label":"acquia:7.x-3.x","ref":"7.x-3.x","sha":"ef581ee7fe43fb71e498ffdc7a0fbf8e3eb60d4e","user":{"login":"acquia","id":514789,"avatar_url":"https://avatars.githubusercontent.com/u/514789?v=3","gravatar_id":"","url":"https://api.github.com/users/acquia","html_url":"https://github.com/acquia","followers_url":"https://api.github.com/users/acquia/followers","following_url":"https://api.github.com/users/acquia/following{/other_user}","gists_url":"https://api.github.com/users/acquia/gists{/gist_id}","starred_url":"https://api.github.com/users/acquia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/acquia/subscriptions","organizations_url":"https://api.github.com/users/acquia/orgs","repos_url":"https://api.github.com/users/acquia/repos","events_url":"https://api.github.com/users/acquia/events{/privacy}","received_events_url":"https://api.github.com/users/acquia/received_events","type":"Organization","site_admin":false},"repo":{"id":17344049,"name":"acquia_lift","full_name":"acquia/acquia_lift","owner":{"login":"acquia","id":514789,"avatar_url":"https://avatars.githubusercontent.com/u/514789?v=3","gravatar_id":"","url":"https://api.github.com/users/acquia","html_url":"https://github.com/acquia","followers_url":"https://api.github.com/users/acquia/followers","following_url":"https://api.github.com/users/acquia/following{/other_user}","gists_url":"https://api.github.com/users/acquia/gists{/gist_id}","starred_url":"https://api.github.com/users/acquia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/acquia/subscriptions","organizations_url":"https://api.github.com/users/acquia/orgs","repos_url":"https://api.github.com/users/acquia/repos","events_url":"https://api.github.com/users/acquia/events{/privacy}","received_events_url":"https://api.github.com/users/acquia/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/acquia/acquia_lift","description":"Mirror of the drupal.org repository for Acquia Lift module","fork":false,"url":"https://api.github.com/repos/acquia/acquia_lift","forks_url":"https://api.github.com/repos/acquia/acquia_lift/forks","keys_url":"https://api.github.com/repos/acquia/acquia_lift/keys{/key_id}","collaborators_url":"https://api.github.com/repos/acquia/acquia_lift/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/acquia/acquia_lift/teams","hooks_url":"https://api.github.com/repos/acquia/acquia_lift/hooks","issue_events_url":"https://api.github.com/repos/acquia/acquia_lift/issues/events{/number}","events_url":"https://api.github.com/repos/acquia/acquia_lift/events","assignees_url":"https://api.github.com/repos/acquia/acquia_lift/assignees{/user}","branches_url":"https://api.github.com/repos/acquia/acquia_lift/branches{/branch}","tags_url":"https://api.github.com/repos/acquia/acquia_lift/tags","blobs_url":"https://api.github.com/repos/acquia/acquia_lift/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/acquia/acquia_lift/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/acquia/acquia_lift/git/refs{/sha}","trees_url":"https://api.github.com/repos/acquia/acquia_lift/git/trees{/sha}","statuses_url":"https://api.github.com/repos/acquia/acquia_lift/statuses/{sha}","languages_url":"https://api.github.com/repos/acquia/acquia_lift/languages","stargazers_url":"https://api.github.com/repos/acquia/acquia_lift/stargazers","contributors_url":"https://api.github.com/repos/acquia/acquia_lift/contributors","subscribers_url":"https://api.github.com/repos/acquia/acquia_lift/subscribers","subscription_url":"https://api.github.com/repos/acquia/acquia_lift/subscription","commits_url":"https://api.github.com/repos/acquia/acquia_lift/commits{/sha}","git_commits_url":"https://api.github.com/repos/acquia/acquia_lift/git/commits{/sha}","comments_url":"https://api.github.com/repos/acquia/acquia_lift/comments{/number}","issue_comment_url":"https://api.github.com/repos/acquia/acquia_lift/issues/comments{/number}","contents_url":"https://api.github.com/repos/acquia/acquia_lift/contents/{+path}","compare_url":"https://api.github.com/repos/acquia/acquia_lift/compare/{base}...{head}","merges_url":"https://api.github.com/repos/acquia/acquia_lift/merges","archive_url":"https://api.github.com/repos/acquia/acquia_lift/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/acquia/acquia_lift/downloads","issues_url":"https://api.github.com/repos/acquia/acquia_lift/issues{/number}","pulls_url":"https://api.github.com/repos/acquia/acquia_lift/pulls{/number}","milestones_url":"https://api.github.com/repos/acquia/acquia_lift/milestones{/number}","notifications_url":"https://api.github.com/repos/acquia/acquia_lift/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/acquia/acquia_lift/labels{/name}","releases_url":"https://api.github.com/repos/acquia/acquia_lift/releases{/id}","deployments_url":"https://api.github.com/repos/acquia/acquia_lift/deployments","created_at":"2014-03-02T18:42:14Z","updated_at":"2014-08-25T15:09:47Z","pushed_at":"2016-11-21T12:15:10Z","git_url":"git://github.com/acquia/acquia_lift.git","ssh_url":"git@github.com:acquia/acquia_lift.git","clone_url":"https://github.com/acquia/acquia_lift.git","svn_url":"https://github.com/acquia/acquia_lift","homepage":"","size":7954,"stargazers_count":2,"watchers_count":2,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":12,"mirror_url":null,"open_issues_count":4,"forks":12,"open_issues":4,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/acquia/acquia_lift/pulls/245"},"html":{"href":"https://github.com/acquia/acquia_lift/pull/245"},"issue":{"href":"https://api.github.com/repos/acquia/acquia_lift/issues/245"},"comments":{"href":"https://api.github.com/repos/acquia/acquia_lift/issues/245/comments"},"review_comments":{"href":"https://api.github.com/repos/acquia/acquia_lift/pulls/245/comments"},"review_comment":{"href":"https://api.github.com/repos/acquia/acquia_lift/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/acquia/acquia_lift/pulls/245/commits"},"statuses":{"href":"https://api.github.com/repos/acquia/acquia_lift/statuses/8d35ed293af336a521d15ba95e8f745b366f8d82"}}}}
{"actor":{"display_login":"eshtadc"}}