You are here

function fbconnect_appearance_settings in Facebook Connect 6

Same name and namespace in other branches
  1. 8.2 fbconnect.admin.inc \fbconnect_appearance_settings()
  2. 6.2 fbconnect.admin.inc \fbconnect_appearance_settings()
  3. 7.2 fbconnect.admin.inc \fbconnect_appearance_settings()
1 string reference to 'fbconnect_appearance_settings'
fbconnect_menu in ./fbconnect.module
Implementation of hook_menu().

File

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

Code

function fbconnect_appearance_settings(&$form_state) {
  $form['site'] = array(
    '#type' => 'fieldset',
    '#title' => t('Settings for !site', array(
      '!site' => variable_get('site_name', t('Your Site')),
    )),
    '#collapsible' => TRUE,
    '#collapsed' => FALSE,
  );
  $form['site']['fbconnect_fast_reg'] = array(
    '#type' => 'checkbox',
    '#title' => t('Fast registration mode'),
    '#default_value' => variable_get('fbconnect_fast_reg', NULL),
    '#description' => t('Unable this mode will bypass drupal\'s standard registration form.'),
  );
  $form['site']['fbconnect_loginout_mode'] = array(
    '#type' => 'select',
    '#title' => t('Login/logout mode'),
    '#options' => array(
      'manual' => t('Manual'),
      'ask' => t('Ask user to logout from FB'),
      'auto' => t('Auto login/logout'),
    ),
    '#default_value' => variable_get('fbconnect_loginout_mode', FALSE),
    '#description' => t('Login to drupal/logout from facebook. Enable this if you don\'t want to logout automatically from facebook.'),
  );
  $form['site']['fbconnect_invite_msg'] = array(
    '#type' => 'textfield',
    '#title' => t('Invite message'),
    '#default_value' => variable_get('fbconnect_invite_msg', t('Enjoy facebook connect')),
  );
  $form['site']['fbconnect_invite_name'] = array(
    '#type' => 'textfield',
    '#title' => t('Your site name'),
    '#default_value' => variable_get('fbconnect_invite_name', variable_get('site_name', NULL)),
  );
  $form['site']['fbconnect_invite_dest'] = array(
    '#type' => 'textfield',
    '#title' => t('Destination, after user\'s valid or skip invite friend form'),
    '#default_value' => variable_get('fbconnect_invite_dest', $base_url),
  );
  $form['site']['fbconnect_reg_options'] = array(
    '#type' => 'checkbox',
    '#title' => t('Disable linking accounts during registration'),
    '#default_value' => variable_get('fbconnect_reg_options', 0),
    '#description' => t('Disables the option to link local account to a FB account on registration'),
  );
  $form['display'] = array(
    '#title' => t('Display Settings'),
    '#type' => 'fieldset',
    '#collapsible' => TRUE,
    '#collapsed' => FALSE,
  );
  if (fbconnect_get_config()) {
    $button = array(
      'small_short' => fbconnect_render_button(array(
        'size' => 'small',
        'onclick' => 'return false;',
      )),
      'medium_short' => fbconnect_render_button(array(
        'size' => 'medium',
        'onclick' => 'return false;',
      )),
      'large_short' => fbconnect_render_button(array(
        'size' => 'large',
        'onclick' => 'return false;',
      )),
    );
    $form['display']['fbconnect_button'] = array(
      '#type' => 'radios',
      '#default_value' => variable_get('fbconnect_button', 'medium_short'),
      '#options' => $button,
    );
    $form['display']['fbconnect_button_text'] = array(
      '#title' => t('Button text'),
      '#type' => 'textfield',
      '#description' => t('Enter the text you want to display on the Facebook Connect Button.'),
      '#default_value' => variable_get('fbconnect_button_text', 'Connect'),
    );
  }
  $form['display']['fbconnect_pic_allow'] = array(
    '#type' => 'select',
    '#title' => t('Facebook picture settings'),
    '#description' => t('Here you can deside whether you want to allow the use of the facebook picture - or not.'),
    '#default_value' => variable_get('fbconnect_pic_allow', 'allow'),
    '#options' => array(
      'allow' => t('Let the user choose'),
      'disallow' => t('Do not allow the use of facebook user picture at your site'),
    ),
  );
  $form['display']['fbconnect_pic_size'] = array(
    '#type' => 'select',
    '#title' => t('Facebook picture size'),
    '#description' => t('If your user decides to use his facebook picture, choose its size here.'),
    '#default_value' => variable_get('fbconnect_pic_size', 'square'),
    '#options' => array(
      'thumb' => t('Thumb'),
      'small' => t('Small'),
      'normal' => t('Normal'),
      'square' => t('square'),
    ),
  );
  $form['display']['fbconnect_pic_logo'] = array(
    '#type' => 'checkbox',
    '#title' => t('Show Facebook Logo'),
    '#description' => t('Uncheck this if you don\'t want to display the facebook logo on the user picture.'),
    '#default_value' => variable_get('fbconnect_pic_logo', TRUE),
  );
  return system_settings_form($form);
}