function fbconnect_appearance_settings in Facebook Connect 7.2
Same name and namespace in other branches
- 8.2 fbconnect.admin.inc \fbconnect_appearance_settings()
- 6.2 fbconnect.admin.inc \fbconnect_appearance_settings()
- 6 fbconnect.admin.inc \fbconnect_appearance_settings()
1 string reference to 'fbconnect_appearance_settings'
- fbconnect_menu in ./
fbconnect.module - Implements hook_menu().
File
- ./
fbconnect.admin.inc, line 80 - Administration page callbacks for the fbconnect module.
Code
function fbconnect_appearance_settings($form, &$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("Enable this mode will bypass Drupal's standard registration form."),
);
$form['site']['fbconnect_fast_reg_autoname'] = array(
'#type' => 'checkbox',
'#title' => t('Assign new random name on name conflict during Fast Registration'),
'#default_value' => variable_get('fbconnect_fast_reg_autoname', NULL),
'#description' => t("Creates a new random name for the user if the user's Facebook is already taken by another user on this site. The random name will look something like fbuser123."),
);
$form['site']['fbconnect_loginout_mode'] = array(
'#type' => 'select',
'#title' => t('Login/logout mode'),
'#options' => array(
'manual' => t('Manual'),
'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."),
);
// TODO: rename to more clear name
$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['site']['fbconnect_user_reg_display'] = array(
'#type' => 'checkbox',
'#title' => t('Display FBConnect button on registration form'),
'#default_value' => variable_get('fbconnect_user_reg_display', TRUE),
'#description' => t('Add the FBConnect button to the "create new account" form. This will only appear if "fast registration mode" is not selected.'),
);
$form['site']['fbconnect_user_reg_location'] = array(
'#type' => 'select',
'#title' => t('Location of FBConnect button on registration form'),
'#default_value' => variable_get('fbconnect_user_reg_location', 'top'),
'#options' => array(
'top' => t('Top'),
'bottom' => t('Bottom'),
),
);
$form['display'] = array(
'#title' => t('Display Settings'),
'#type' => 'fieldset',
'#collapsible' => TRUE,
'#collapsed' => FALSE,
);
if (fbconnect_get_config() && module_exists('fbconnect_login')) {
$button = array(
'small_short' => fbconnect_login_render_button(array(
'size' => 'small',
'onclick' => 'return false;',
), 'register'),
'medium_short' => fbconnect_login_render_button(array(
'size' => 'medium',
'onclick' => 'return false;',
), 'register'),
'large_short' => fbconnect_login_render_button(array(
'size' => 'large',
'onclick' => 'return false;',
), 'register'),
);
$form['display']['fbconnect_button'] = array(
'#title' => t('Facebook Button Size'),
'#type' => 'radios',
'#default_value' => variable_get('fbconnect_button', 'medium_short'),
'#options' => $button,
);
$form['display']['fbconnect_button_register_text'] = array(
'#title' => t('Not Logged into Facebook Text'),
'#type' => 'textfield',
'#description' => t('The user is not logged into Facebook or this site so we have not info about their status.'),
'#default_value' => variable_get('fbconnect_button_register_text', 'Connect'),
);
$form['display']['fbconnect_button_login_text'] = array(
'#type' => 'textfield',
'#title' => t('Logged into Facebook and Registered but not Logged Into This Site'),
'#description' => t('They are logged into Facebook and have registered but not logged into this site (manual mode only)'),
'#states' => array(
'visible' => array(
':input[name="fbconnect_loginout_mode"]' => array(
'value' => t('manual'),
),
),
),
'#default_value' => variable_get('fbconnect_button_login_text', 'Login'),
);
}
$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'),
),
);
$options_pic_size = array(
'thumb' => t('Thumb (50px wide)'),
'small' => t('Small (100px wide)'),
'normal' => t('Normal (200px wide)'),
'square' => t('Square (50px by 50px)'),
);
$form['display']['fbconnect_pic_size'] = array(
'#type' => 'select',
'#title' => t('Default Facebook picture size'),
'#description' => t('This will set the default user picture size throughout the site. If your user decides to use his Facebook picture, choose its size here.'),
'#default_value' => variable_get('fbconnect_pic_size', 'square'),
'#options' => $options_pic_size,
);
$form['display']['fbconnect_pic_size_nodes'] = array(
'#type' => 'select',
'#title' => t('Node Facebook picture size'),
'#description' => t('This will set the picture size when viewing a node post. If your user decides to use his Facebook picture, choose its size here.'),
'#default_value' => variable_get('fbconnect_pic_size_nodes', 'square'),
'#options' => $options_pic_size,
);
$form['display']['fbconnect_pic_size_comments'] = array(
'#type' => 'select',
'#title' => t('Comments Facebook picture size'),
'#description' => t('This will set the picture size when viewing a comment post. If your user decides to use his Facebook picture, choose its size here.'),
'#default_value' => variable_get('fbconnect_pic_size_comments', 'square'),
'#options' => $options_pic_size,
);
$form['display']['fbconnect_pic_size_profile'] = array(
'#type' => 'select',
'#title' => t('Profile Facebook picture size'),
'#description' => t("This will set the picture size when viewing a user's profile page. If your user decides to use his Facebook picture, choose its size here."),
'#default_value' => variable_get('fbconnect_pic_size_profile', 'small'),
'#options' => $options_pic_size,
);
$form['additional'] = array(
'#type' => 'fieldset',
'#title' => t('Additional'),
'#collapsible' => TRUE,
'#collapsed' => FALSE,
);
$form['additional']['fbconnect_exclude_patterns'] = array(
'#type' => 'textarea',
'#title' => t('Disable FBConnect on specified pages'),
'#description' => t('Enter here path patterns accepted by !drupal_match_path function. One per line.', array(
'!drupal_match_path' => l('drupal_match_path', 'http://api.drupal.org/api/drupal/includes--path.inc/function/drupal_match_path/6', array(
'attributes' => array(
'target' => '_blank',
),
)),
)),
'#default_value' => variable_get('fbconnect_exclude_patterns', ''),
);
return system_settings_form($form);
}