You are here

function acquia_lift_target_option_targeted in Acquia Lift Connector 7.2

Checks to see if an option within an option set is currently targeted.

Parameters

string $agent_name: The name of the agent to check.

string $option_id: The option id to check.

Return value

bool True if the option set is targeted, false otherwise.

6 calls to acquia_lift_target_option_targeted()
acquia_lift_form_personalize_blocks_form_alter in ./acquia_lift.module
Implements hook_form_FORM_ID_alter().
acquia_lift_get_option_set_editable_settings in ./acquia_lift.module
Helper function to generate editable JavaScript settings for an option set.
acquia_lift_personalize_elements_form_validate in ./acquia_lift.module
Validation handler for personalize_elements_form.
acquia_lift_personalize_fields_form_element_validate in ./acquia_lift.module
Personalized fields element validation.
acquia_lift_personalize_option_set_presave in ./acquia_lift.module
Implements hook_personalize_option_set_presave().

... See full list

File

./acquia_lift.admin.inc, line 2161
acquia_lift.admin.inc Provides functions needed for the admin UI.

Code

function acquia_lift_target_option_targeted($agent_name, $option_id) {

  // We only care about saved targeting that has been created.
  $option_set = acquia_lift_get_option_set_for_targeting($agent_name);
  $targeting = acquia_lift_get_structure_from_targeting($option_set);
  foreach ($targeting as $options) {
    if (in_array($option_id, $options)) {
      return TRUE;
    }
  }
  return FALSE;
}