You are here

function fbconnect_fbapp_settings in Facebook Connect 8.2

Same name and namespace in other branches
  1. 6.2 fbconnect.admin.inc \fbconnect_fbapp_settings()
  2. 6 fbconnect.admin.inc \fbconnect_fbapp_settings()
  3. 7.2 fbconnect.admin.inc \fbconnect_fbapp_settings()
1 string reference to 'fbconnect_fbapp_settings'
fbconnect_menu in ./fbconnect.module
Implements hook_menu().

File

./fbconnect.admin.inc, line 251
Administration page callbacks for the fbconnect module.

Code

function fbconnect_fbapp_settings($form, &$form_state) {
  if (!facebook_client()) {
    drupal_set_message(t('Ensure that you entered valid api keys.'), 'error');
    drupal_goto('admin/config/people/fbconnect');
  }
  $fbuid = fbconnect_get_fbuid();
  if (empty($fbuid)) {
    $button_attr = array(
      'text' => t('Connect with your Facebook account'),
    );
    $form['fbconnect'] = array(
      '#prefix' => '<div>' . t('You are not connected to the Facebook account that this application is registered to') . '</div>',
      '#markup' => fbconnect_render_button($button_attr),
    );
    return $form;
  }
  $form['fbconnect_base_domaine'] = array(
    '#type' => 'textfield',
    '#title' => t('Base Domain Url'),
    '#description' => t('Use this to enable your Facebook Connect implementation to span multiple subdomains (e.g., using example.com would enable  www.example.com, foo.example.com or bar.example.com,).'),
    '#default_value' => variable_get('fbconnect_base_domaine', NULL),
  );
  $form['fbconnect_connect_url'] = array(
    '#type' => 'textfield',
    '#title' => t('Connect Url'),
    '#description' => t("Your site's main URL."),
    '#default_value' => variable_get('fbconnect_connect_url', $GLOBALS['base_url'] . '/'),
  );
  $form['fbconnect_uninstall_url'] = array(
    '#type' => 'textfield',
    '#title' => t('Post-Remove Callback Url'),
    '#description' => t('Facebook pings this URL when a user removes your application.'),
    '#default_value' => variable_get('fbconnect_uninstall_url', url('fbconnect/post-remove', array(
      'absolute' => TRUE,
    ))),
  );
  $form = system_settings_form($form);
  $form['#submit'][] = 'fbconnect_fbapp_settings_submit';
  return $form;
}