You are here

function fb_feed_deactivate_confirm in Drupal for Facebook 5.2

1 string reference to 'fb_feed_deactivate_confirm'
fb_feed_menu in ./fb_feed.module

File

./fb_feed.module, line 55
Helpers for Facebook feeds (http://wiki.developers.facebook.com/index.php/New_Design_Feed_Wall)

Code

function fb_feed_deactivate_confirm($fb_app_nid, $bundle_id) {
  $result = db_query("SELECT n.nid, n.title FROM {node} n LEFT JOIN {fb_feed_template} fft ON fft.nid = n.nid WHERE fft.fb_app_nid = %d AND fft.bundle_id = %f", $fb_app_nid, $bundle_id);
  $data = db_fetch_object($result);
  if ($data->nid) {
    $form['nid'] = array(
      '#type' => 'hidden',
      '#value' => $data->nid,
    );
    $description = t('This will deactivate the template on Facebook.  The template node will not be deleted.');
    $question = t('Really deactivate the !template_link template?', array(
      '!template_link' => l($data->title, 'node/' . $data->nid),
    ));
  }
  else {
    $question = t('Really deactivate template bundle %bundle_id?', array(
      '%bundle_id' => $bundle_id,
    ));
  }
  $form['bundle_id'] = array(
    '#type' => 'hidden',
    '#value' => $bundle_id,
  );
  $form['fb_app_nid'] = array(
    '#type' => 'hidden',
    '#value' => $fb_app_nid,
  );
  return confirm_form($form, $question, 'node/' . $fb_app_nid . '/fb_feed/templates', $description);
}