SocialGroupSettings.php in Open Social 8.2
Same filename and directory in other branches
- 8.9 modules/social_features/social_group/src/Form/SocialGroupSettings.php
- 8 modules/social_features/social_group/src/Form/SocialGroupSettings.php
- 8.3 modules/social_features/social_group/src/Form/SocialGroupSettings.php
- 8.4 modules/social_features/social_group/src/Form/SocialGroupSettings.php
- 8.5 modules/social_features/social_group/src/Form/SocialGroupSettings.php
- 8.6 modules/social_features/social_group/src/Form/SocialGroupSettings.php
- 8.7 modules/social_features/social_group/src/Form/SocialGroupSettings.php
- 8.8 modules/social_features/social_group/src/Form/SocialGroupSettings.php
- 10.3.x modules/social_features/social_group/src/Form/SocialGroupSettings.php
- 10.0.x modules/social_features/social_group/src/Form/SocialGroupSettings.php
- 10.1.x modules/social_features/social_group/src/Form/SocialGroupSettings.php
- 10.2.x modules/social_features/social_group/src/Form/SocialGroupSettings.php
Namespace
Drupal\social_group\FormFile
modules/social_features/social_group/src/Form/SocialGroupSettings.phpView source
<?php
namespace Drupal\social_group\Form;
use Drupal\Core\Form\ConfigFormBase;
use Drupal\Core\Form\FormStateInterface;
/**
* Class SocialGroupSettings.
*
* @package Drupal\social_event_managers\Form
*/
class SocialGroupSettings extends ConfigFormBase {
/**
* {@inheritdoc}
*/
protected function getEditableConfigNames() {
return [
'social_group.settings',
];
}
/**
* {@inheritdoc}
*/
public function getFormId() {
return 'social_group_form';
}
/**
* {@inheritdoc}
*/
public function buildForm(array $form, FormStateInterface $form_state) {
$config = $this
->config('social_group.settings');
$form['allow_group_selection_in_node'] = [
'#type' => 'checkbox',
'#title' => $this
->t('Allow logged-in users to change or remove a group when editing content'),
'#description' => $this
->t('When checked, logged-in users can also move content to or out of a group after the content is created. Users can only move content to a group the author is a member of.'),
'#default_value' => $config
->get('allow_group_selection_in_node'),
];
return parent::buildForm($form, $form_state);
}
/**
* {@inheritdoc}
*/
public function submitForm(array &$form, FormStateInterface $form_state) {
parent::submitForm($form, $form_state);
$this
->config('social_group.settings')
->set('allow_group_selection_in_node', $form_state
->getValue('allow_group_selection_in_node'))
->save();
}
}
Classes
Name![]() |
Description |
---|---|
SocialGroupSettings | Class SocialGroupSettings. |