function social_form_install_configure_form_alter in Open Social 8
Same name and namespace in other branches
- 8.2 social.profile \social_form_install_configure_form_alter()
- 8.3 social.profile \social_form_install_configure_form_alter()
- 8.4 social.profile \social_form_install_configure_form_alter()
- 8.5 social.profile \social_form_install_configure_form_alter()
- 8.6 social.profile \social_form_install_configure_form_alter()
- 8.7 social.profile \social_form_install_configure_form_alter()
Implements hook_form_FORM_ID_alter() for install_configure_form().
Allows the profile to alter the site configuration form.
File
- ./
social.profile, line 127 - Enables modules and site configuration for a social site installation.
Code
function social_form_install_configure_form_alter(&$form, FormStateInterface $form_state) {
// Add 'Social' fieldset and options.
$form['social'] = [
'#type' => 'fieldgroup',
'#title' => t('Open Social optional configuration'),
'#description' => t('All the required modules and configuration will be automatically installed and imported. You can optionally select additional features or generated demo content.'),
'#weight' => 50,
];
$social_optional_modules = [
'social_book' => t('Book functionality'),
'social_sharing' => t('Share content on social media'),
'social_event_type' => t('Categorize events in event types'),
'social_sso' => t('Registration with social networks'),
'social_file_private' => t('Use the private file system for uploaded files (highly recommended)'),
];
// Checkboxes to enable Optional modules.
$form['social']['optional_modules'] = [
'#type' => 'checkboxes',
'#title' => t('Enable additional features'),
'#options' => $social_optional_modules,
'#default_value' => [
'social_file_private',
],
];
// Checkboxes to generate demo content.
$form['social']['demo_content'] = [
'#type' => 'checkbox',
'#title' => t('Generate demo content and users'),
'#description' => t('Will generate files, users, groups, events, topics, comments and posts.'),
];
// Submit handler to enable features.
$form['#submit'][] = 'social_features_submit';
}