-
Notifications
You must be signed in to change notification settings - Fork 8
/
settings.php
70 lines (61 loc) · 2.53 KB
/
settings.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<?php
$default_settings = [
# This acts as an intersection filter with the languages enabled
# in the connected deployment. If left empty, no filtering is applied
# Specify langauges as configured in Platform surveys, i.e. [ 'en-US', 'es-ES' ]
"enabled_languages" => [],
# This acts as an intersection filter with the surveys present in the
# connected deployment. If left empty, no filtering is applied.
# At the moment, survey selection can be done only by id, i.e.:
# [{"id": 1}, {"id": 2}] --> enables surveys with id=1 and id=2 only
"enabled_surveys" => [],
# This specifies what behavior to apply for default values defined
# in survey fields. Three possible behaviours are available:
# 'ignore' : don't use the default values
# 'use' : use as default value in the USSD interaction
# 'skip' : use the default value as response and don't present the
# question to the end-user
"when_default_values" => [
"title" => "ignore",
"description" => "ignore",
"other" => "ignore" # TODO: not implemented for now, see FieldQuestionFactory class to enable
],
# Send question for survey selection confirmation
"confirm_survey_selection" => true,
# USSD-specific settings
"ussd" => [
# Should we show hints for specific field types.
# The keys for this array match the values returned by the
# getAtributeName() method in the different App\Messages\Outgoing\Fields questions
"show_hints_for_field_type" => [
"categories" => false,
"checkboxes" => true,
"date" => true,
"datetime" => true,
"decimal" => false,
"description" => false,
"image" => false,
"integer" => false,
"location" => true,
"long text" => false,
"markdown" => false,
"radio buttons" => false,
"select" => false,
"short text" => false,
"title" => false,
"video" => false,
],
# Disable field types for user input via USSD?
"is_disabled_field_type" => [
"image" => true,
"location" => true,
"video" => true,
],
],
];
if (file_exists(base_path('settings.json'))) {
$settings = json_decode(file_get_contents(base_path('settings.json')), true);
# Merge with defaults
$settings = array_replace_recursive($default_settings, $settings);
}
return $settings ?? $default_settings;