function fb_form_request_form in Drupal for Facebook 6.2
Same name and namespace in other branches
- 5.2 fb_form.module \fb_form_request_form()
- 5 fb_form.module \fb_form_request_form()
Helper function to produce a request or invite form. Note that this does not produce a full form (i.e. never use drupal_get_form('fb_form_request_form')). The caller is expected to fill out the rest of the form before returning it for use with drupal_get_form.
DEPRECATED
File
- ./
fb_form.module, line 197 - This module defines facebook-specific form elements for use with Drupal's form API.
Code
function fb_form_request_form($config = array()) {
global $_fb, $_fb_app;
// only works on canvas pages.
// Default config
$config = array_merge(array(
'type' => $_fb_app->label,
'content' => 'INVITE CONTENT XXX',
'action' => 'http://apps.facebook.com/' . $_fb_app->canvas,
'invite' => 'true',
'method' => 'POST',
), $config);
// form type fb:request-form
$form = array(
'#fb_form_type_hack' => 'fb_form_request',
/* becomes #type during form_alter */
'#attributes' => array(
'type' => $config['type'],
'content' => htmlentities($config['content']),
'invite' => $config['invite'],
),
'#action' => $config['action'],
);
// Caller must add fb:multi-friend-selector or some other selector.
return $form;
}