You are here

function fb_connect_app_submit in Drupal for Facebook 7.3

Same name and namespace in other branches
  1. 6.3 fb_connect.module \fb_connect_app_submit()
  2. 6.2 fb_connect.module \fb_connect_app_submit()

Submit callback. Sets or unsets "primary" app.

1 string reference to 'fb_connect_app_submit'
fb_connect_form_alter in ./fb_connect.module
Implements hook_form_alter().

File

./fb_connect.module, line 382
Support for Facebook Connect features

Code

function fb_connect_app_submit($form, &$form_state) {
  $values = $form_state['values'];
  $label = $values['label'];
  $data = $values['fb_app_data']['fb_connect'];
  if ($data['primary']) {
    variable_set(FB_CONNECT_VAR_PRIMARY, $label);
    drupal_set_message(t('%label is the primary Facebook Connect application.', array(
      '%label' => $label,
    )));
  }
  elseif ($label == variable_get(FB_CONNECT_VAR_PRIMARY, NULL)) {

    // This app was the primary one, but the user has unchecked it.
    variable_set(FB_CONNECT_VAR_PRIMARY, NULL);
  }
}