You are here

function fb_tab_form_alter in Drupal for Facebook 7.3

Same name and namespace in other branches
  1. 6.3 fb_tab.module \fb_tab_form_alter()

Implements fb_tab_form_alter.

File

./fb_tab.module, line 278
This module provides support for "Profile Tabs" that can be added to facebook pages (no longer allowed for user profiles).

Code

function fb_tab_form_alter(&$form, &$form_state, $form_id) {
  if (isset($form['fb_app_data']) && is_array($form['fb_app_data'])) {

    // Add our settings to the fb_app edit form.

    //require 'fb_canvas.admin.inc';
    fb_tab_admin_form_alter($form, $form_state, $form_id);
  }
  if (!empty($_REQUEST['signed_request']) && empty($form['signed_request']) && fb_is_tab()) {

    // Facebook will pass us the important signed_request.
    // When we submit a form, that data will be lost unless we explicitly include it in the form.
    $form['signed_request'] = array(
      '#type' => 'hidden',
      '#value' => $_REQUEST['signed_request'],
    );
  }
}