You are here

function acquia_lift_form_personalize_agent_option_sets_form_alter in Acquia Lift Connector 7

Same name and namespace in other branches
  1. 7.2 acquia_lift.module \acquia_lift_form_personalize_agent_option_sets_form_alter()

Implements hook_form_FORM_ID_alter().

Alters the option sets form so that it can't be used for explicit targeting on a Lift Target agent.

File

./acquia_lift.module, line 2456
acquia_lift.module Provides Acquia Lift-specific personalization functionality.

Code

function acquia_lift_form_personalize_agent_option_sets_form_alter(&$form, &$form_state) {
  if ($form['#agent']->plugin != 'acquia_lift_target') {
    return;
  }
  foreach ($form['variations']['primary']['option_sets'] as $name => $elements) {
    if (isset($elements['options'])) {
      unset($form['variations']['primary']['option_sets'][$name]['options']);
    }
  }
}