function acquia_lift_element_variation_delete_form_submit in Acquia Lift Connector 7.2
Same name and namespace in other branches
- 7 acquia_lift.admin.unibar.inc \acquia_lift_element_variation_delete_form_submit()
Submit handler for acquia_lift_element_variation_delete_form().
File
Code
function acquia_lift_element_variation_delete_form_submit($form, &$form_state) {
$option_set = $form_state['values']['option_set'];
foreach ($option_set->options as $key => $option) {
if ($option['option_id'] === $form_state['values']['option_id']) {
unset($option_set->options[$key]);
break;
}
}
// @todo: This logic should be moved into personalize.
if (count($option_set->options) < 2) {
personalize_option_set_delete($option_set->osid);
}
else {
personalize_option_set_save($option_set);
}
}