File tree Expand file tree Collapse file tree 2 files changed +28
-3
lines changed Expand file tree Collapse file tree 2 files changed +28
-3
lines changed Original file line number Diff line number Diff line change @@ -156,7 +156,6 @@ public function buildForm(FormBuilderInterface $builder): void
156
156
->add ('allow_my_files ' , YesNoType::class)
157
157
// old settings with no category
158
158
->add ('chamilo_database_version ' )
159
- ->add ('registered ' , YesNoType::class)
160
159
->add (
161
160
'load_term_conditions_section ' ,
162
161
ChoiceType::class,
@@ -276,6 +275,16 @@ public function buildForm(FormBuilderInterface $builder): void
276
275
$ this ->updateFormFieldsFromSettingsInfo ($ builder );
277
276
}
278
277
278
+ /**
279
+ * Returns the list of internal settings that should be hidden from forms and search.
280
+ */
281
+ public function getHiddenSettings (): array
282
+ {
283
+ return [
284
+ 'registered ' ,
285
+ ];
286
+ }
287
+
279
288
private function settingArrayHelpValue (string $ variable ): string
280
289
{
281
290
$ values = [
Original file line number Diff line number Diff line change @@ -401,9 +401,25 @@ public function getParametersFromKeywordOrderedByCategory($keyword): array
401
401
$ parametersFromDb = $ query ->getQuery ()->getResult ();
402
402
$ parameters = [];
403
403
404
- /** @var SettingsCurrent $parameter */
405
404
foreach ($ parametersFromDb as $ parameter ) {
406
- $ parameters [$ parameter ->getCategory ()][] = $ parameter ;
405
+ /** @var SettingsCurrent $parameter */
406
+ $ category = $ parameter ->getCategory ();
407
+ $ variable = $ parameter ->getVariable ();
408
+
409
+ $ hidden = [];
410
+ $ serviceKey = 'chamilo_core.settings. ' .$ category ;
411
+ if ($ this ->schemaRegistry ->has ($ serviceKey )) {
412
+ $ schema = $ this ->schemaRegistry ->get ($ serviceKey );
413
+ if (method_exists ($ schema , 'getHiddenSettings ' )) {
414
+ $ hidden = $ schema ->getHiddenSettings ();
415
+ }
416
+ }
417
+
418
+ if (in_array ($ variable , $ hidden , true )) {
419
+ continue ;
420
+ }
421
+
422
+ $ parameters [$ category ][] = $ parameter ;
407
423
}
408
424
409
425
return $ parameters ;
You can’t perform that action at this time.
0 commit comments