You are here

function acquia_lift_page_variation_get_name in Acquia Lift Connector 7

Gets the name of a specific page variation set variation.

Parameters

string $variation_set_name: The name of the variation set that this variation belongs to.

string $agent_name: The name of the campaign/agent for this page variation.

number $variation_number: The number of variation within the variation set to retrieve.

2 calls to acquia_lift_page_variation_get_name()
acquia_lift_page_variation_delete_form in ./acquia_lift.admin.unibar.inc
Form handler to generate a confirmation form to delete a variation.
acquia_lift_page_variation_rename_form in ./acquia_lift.admin.unibar.inc
Form handler to generate a form to change a variation name.

File

./acquia_lift.page_variations.inc, line 151
acquia_lift.admin.page_variations.inc

Code

function acquia_lift_page_variation_get_name($variation_set_name, $agent_name, $variation_number) {
  $option_sets = personalize_option_set_load_multiple(FALSE, array(
    'decision_name' => $variation_set_name,
    'agent' => $agent_name,
  ));
  $option_set = current($option_sets);
  if ($option_set) {
    if (isset($option_set->options[$variation_number])) {
      return filter_xss($option_set->options[$variation_number]['option_label']);
    }
  }
  return '';
}