You are here

function fb_graph_delete_confirm_form_submit in Drupal for Facebook 7.3

Same name and namespace in other branches
  1. 6.3 fb_graph.pages.inc \fb_graph_delete_confirm_form_submit()

File

./fb_graph.pages.inc, line 53

Code

function fb_graph_delete_confirm_form_submit($form, &$form_state) {
  extract(fb_vars());
  $token = fb_get_token($fb, $fbu);
  if ($form_state['values']['confirm']) {
    try {

      // Delete from the graph.
      $result = fb_graph($form_state['values']['fb_graph_id'], array(
        'access_token' => $token,
        'method' => 'delete',
      ), 'POST');
      if ($result) {
        drupal_set_message("Deleted action from Facebook timeline.");
      }
    } catch (Exception $e) {
      fb_log_exception($e, t('Failed to delete %id from Facebook graph.', array(
        '%id' => $form_state['values']['fb_graph_id'],
      )));
    }
  }
}