You are here

function fb_opengraph_delete_confirm_form_submit in Drupal for Facebook 7.4

File

./fb_opengraph.pages.inc, line 52

Code

function fb_opengraph_delete_confirm_form_submit($form, &$form_state) {
  $token = fb_user_token();
  if ($form_state['values']['confirm']) {
    try {

      // Delete from the graph.
      $result = fb_graph_post($form_state['values']['fb_graph_id'], array(
        'access_token' => $token,
        'method' => 'delete',
      ));
      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'],
      )));
    }
  }
}