function fb_canvas_form_alter in Drupal for Facebook 7.3
Same name and namespace in other branches
- 5.2 fb_canvas.module \fb_canvas_form_alter()
- 5 fb_canvas.module \fb_canvas_form_alter()
- 6.3 fb_canvas.module \fb_canvas_form_alter()
- 6.2 fb_canvas.module \fb_canvas_form_alter()
Implements hook_form_alter.
File
- ./
fb_canvas.module, line 217 - This module provides support for Canvas page applications. Use Drupal to power traditional Facebook Apps.
Code
function fb_canvas_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_canvas_admin_form_alter($form, $form_state, $form_id);
}
if (!empty($_REQUEST['signed_request']) && empty($form['signed_request']) && fb_is_canvas()) {
// Facebook will pass our canvas pages 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'],
);
}
}