1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
/* For licensing terms, see /license.txt */ |
6
|
|
|
|
7
|
|
|
namespace Chamilo\CoreBundle\Settings; |
8
|
|
|
|
9
|
|
|
use Chamilo\CoreBundle\Form\Type\YesNoType; |
10
|
|
|
use Sylius\Bundle\SettingsBundle\Schema\AbstractSettingsBuilder; |
11
|
|
|
use Symfony\Component\Form\Extension\Core\Type\TextareaType; |
12
|
|
|
use Symfony\Component\Form\Extension\Core\Type\TextType; |
13
|
|
|
use Symfony\Component\Form\FormBuilderInterface; |
14
|
|
|
|
15
|
|
|
final class PrivacySettingsSchema extends AbstractSettingsSchema |
16
|
|
|
{ |
17
|
|
|
public function buildSettings(AbstractSettingsBuilder $builder): void |
18
|
|
|
{ |
19
|
|
|
$builder->setDefaults([ |
20
|
|
|
'disable_change_user_visibility_for_public_courses' => 'true', |
21
|
|
|
'disable_gdpr' => 'true', |
22
|
|
|
'data_protection_officer_name' => '', |
23
|
|
|
'data_protection_officer_role' => '', |
24
|
|
|
'data_protection_officer_email' => '', |
25
|
|
|
'hide_user_field_from_list' => '', |
26
|
|
|
]); |
27
|
|
|
} |
28
|
|
|
|
29
|
|
|
public function buildForm(FormBuilderInterface $builder): void |
30
|
|
|
{ |
31
|
|
|
$builder |
32
|
|
|
->add('disable_change_user_visibility_for_public_courses', YesNoType::class) |
33
|
|
|
->add('disable_gdpr', YesNoType::class) |
34
|
|
|
->add('data_protection_officer_name', TextType::class) |
35
|
|
|
->add('data_protection_officer_role', TextType::class) |
36
|
|
|
->add('data_protection_officer_email', TextType::class) |
37
|
|
|
->add('hide_user_field_from_list', TextareaType::class) |
38
|
|
|
; |
39
|
|
|
|
40
|
|
|
$this->updateFormFieldsFromSettingsInfo($builder); |
41
|
|
|
} |
42
|
|
|
} |
43
|
|
|
|
44
|
|
|
|