function acquia_lift_goal_delete_form_submit in Acquia Lift Connector 7
Same name and namespace in other branches
- 7.2 acquia_lift.admin.unibar.inc \acquia_lift_goal_delete_form_submit()
Submit handler for acquia_lift_goal_delete_form().
File
- ./
acquia_lift.admin.unibar.inc, line 1505 - acquia_lift.admin.unibar.inc
Code
function acquia_lift_goal_delete_form_submit($form, &$form_state) {
$goals = personalize_goal_load_by_conditions(array(
'agent' => $form_state['values']['agent_name'],
'action' => $form_state['values']['action_name'],
));
if (count($goals) === 1) {
$goal = reset($goals);
personalize_goal_delete($goal->id);
$form_state['acquia_lift']['goal_delete_success'] = TRUE;
}
else {
$form_state['acquia_lift']['goal_delete_success'] = FALSE;
}
}