You are here

function fbconnect_api_keys_settings in Facebook Connect 8.2

Same name and namespace in other branches
  1. 6.2 fbconnect.admin.inc \fbconnect_api_keys_settings()
  2. 6 fbconnect.admin.inc \fbconnect_api_keys_settings()
  3. 7.2 fbconnect.admin.inc \fbconnect_api_keys_settings()

@file Administration page callbacks for the fbconnect module.

1 string reference to 'fbconnect_api_keys_settings'
fbconnect_menu in ./fbconnect.module
Implements hook_menu().

File

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

Code

function fbconnect_api_keys_settings($form, &$form_state) {
  $form['fbconnect_appid'] = array(
    '#type' => 'textfield',
    '#required' => TRUE,
    '#title' => t('Application ID'),
    '#default_value' => variable_get('fbconnect_appid', NULL),
    '#description' => t('Also called the <em>OAuth client_id</em> value on Facebook App settings pages. <a href="https://www.facebook.com/developers/createapp.php">Facebook Apps must first be created</a> before they can be added here.'),
  );
  $form['fbconnect_skey'] = array(
    '#type' => 'textfield',
    '#required' => TRUE,
    '#title' => t('Application Secret'),
    '#default_value' => variable_get('fbconnect_skey', NULL),
    '#description' => t('Also called the <em>OAuth client_secret</em> value on Facebook App settings pages.'),
  );
  $form['fbconnect_language_code'] = array(
    '#type' => 'textfield',
    '#title' => module_exists('i18n') ? t('Default language code') : t('Language code'),
    '#description' => t('Enter your country code here to get translated versions of Facebook connect. (e.g. en_US or de_DE)'),
    '#default_value' => variable_get('fbconnect_language_code', 'en_US'),
  );
  if (module_exists('i18n')) {
    $form['language_codes'] = array(
      '#type' => 'fieldset',
      '#title' => t('Automatically Switch Language Code'),
      '#description' => t('Enable the fbconnect module to use a different language code for each of your site languages.'),
      '#collapsible' => TRUE,
      '#collapsed' => TRUE,
    );
    foreach (language_list() as $langcode => $language) {
      $form['language_codes']['fbconnect_language_code_' . $langcode] = array(
        '#type' => 'select',
        '#title' => t('@name (@native) Language code', array(
          '@name' => $language->name,
          '@native' => $language->native,
        )),
        '#default_value' => variable_get('fbconnect_language_code_' . $langcode, ''),
        '#options' => array(
          '' => t('- Use default -'),
        ) + _fbconnect_language_codes(),
      );
    }
  }
  $form['fbconnect_debug'] = array(
    '#type' => 'checkbox',
    '#title' => t('Debug mode'),
    '#default_value' => variable_get('fbconnect_debug', FALSE),
  );
  $form['fbconnect_ssl'] = array(
    '#type' => 'checkbox',
    '#title' => t('Always use SSL on authentication'),
    '#description' => t('Enable this if you want to use SSL on authentication.'),
    '#default_value' => variable_get('fbconnect_ssl', FALSE),
  );
  $form['fbconnect_connect_url'] = array(
    '#type' => 'textfield',
    '#title' => t('Connect url'),
    '#description' => t('Copy this value into Facebook Applications on Connect settings tab'),
    '#default_value' => variable_get('fbconnect_connect_url', $GLOBALS['base_url'] . '/'),
  );
  $form['fbconnect_noroot'] = array(
    '#title' => t("Don't include settings in footer"),
    '#type' => 'checkbox',
    '#description' => t('Check if other Facebook modules are in use so fb-root code is not added twice.'),
    '#default_value' => variable_get('fbconnect_noroot', ''),
  );

  //  locale
  //  connect_logo_url
  //  about_url
  //  base_domain
  //  tos_url
  return system_settings_form($form);
}