PluginProbe
Age Gate / 3.7.3
Age Gate v3.7.3
3.7.3 trunk 1.0.0 1.0.1 1.1.0 1.2.0 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.4.0 1.4.1 1.4.10 1.4.11 1.4.12 1.4.13 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.4.7 1.4.8 All 113 releases
age-gate / src / Admin / Settings / Restriction.php

Restriction.php in Age Gate 3.7.3, at src/Admin/Settings/Restriction.php

184 lines 7.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace AgeGate\Admin\Settings;
4
5 trait Restriction
6 {
7 protected function getRestrictionFields()
8 {
9 return [
10 [
11 // 'title' => 'gfddf',
12 'subtitle' => __('Below are the core settings to Age Gate your content.', 'age-gate'),
13 'model' => ['input_type', 'remember'],
14 'fields' => [
15 'default_age' => [
16 'default' => 18,
17 'type' => 'number',
18 'subtext' => '',
19 'attributes' => [
20 'class' => 'small-text',
21 'required' => 'required',
22 'min' => 1
23 ],
24 'label' => __('Default age', 'age-gate'),
25 'translate' => true,
26 ],
27 'type' => [
28 'default' => 'all',
29 'type' => 'select',
30 'options' => [
31 'all' => __('All content', 'age-gate'),
32 'selected' => __('Selected content', 'age-gate'),
33 ],
34 'arrtibutes' => [],
35 'label' => __('Restrict', 'age-gate'),
36 ],
37 'multi_age' => [
38 'default' => false,
39 'type' => 'checkbox',
40 'attributes' => [
41
42 ],
43 'label' => __('Varied ages', 'age-gate'),
44 ],
45 'input_type' => [
46 'default' => 'inputs',
47 'type' => 'select',
48 'options' => [
49 'inputs' => __('Input fields', 'age-gate'),
50 'selects' => __('Dropdown fields', 'age-gate'),
51 'buttons' => __('Yes/No buttons', 'age-gate'),
52 ],
53 'label' => __('Validate age using', 'age-gate'),
54 'attributes' => [
55 'x-model' => 'input_type',
56 ]
57 ],
58 'date_format' => [
59 'type' => 'select',
60 'options' => [
61 'DD MM YYYY' => 'DD MM YYYY',
62 'MM DD YYYY' => 'MM DD YYYY',
63 'YYYY MM DD' => 'YYYY MM DD',
64 ],
65 'default' => 'DD MM YYYY',
66 'label' => __('Date format', 'age-gate'),
67 'condition' => [
68 'x-show' => "input_type != 'buttons'"
69 ],
70 'translate' => true,
71 ],
72 'button_order' => [
73 'default' => 'no-yes',
74 'type' => 'select',
75 'options' => [
76 'no-yes' => __('No then Yes', 'age-gate'),
77 'yes-no' => __('Yes then No', 'age-gate'),
78 ],
79 'label' => __('Button order', 'age-gate'),
80 'condition' => [
81 'x-show' => "input_type == 'buttons'"
82 ],
83 'translate' => true,
84 ],
85 'year_order' => [
86 'type' => 'select',
87 'default' => 'low-high',
88 'label' => __('Year order', 'age-gate'),
89 'condition' => [
90 'x-show' => "input_type == 'selects'"
91 ],
92 'options' => [
93 'low-high' => __('Low to high', 'age-gate'),
94 'high-low' => __('High to low', 'age-gate'),
95 ],
96 ],
97 'stepped' => [
98 'type' => 'checkbox',
99 'default' => false,
100 'label' => __('Stepped Inputs', 'age-gate'),
101 'subtext' => __('Not available on all devices', 'age-gate'),
102 'sublabel' => __('BETA', 'age-gate'),
103 'docs' => [
104 'link' => 'https://agegate.io/docs/v3/cms-settings/restrictions/stepped-inputs-beta',
105 'label' => __('Documentation', 'age-gate'),
106 'class' => 'button-text',
107 ],
108 'condition' => [
109 'x-show' => "input_type == 'inputs'"
110 ],
111 ],
112 'remember' => [
113 'default' => false,
114 'type' => 'checkbox',
115 'attributes' => [
116 'x-on:change' => 'remember = ! remember'
117 ],
118 'label' => __('Remember', 'age-gate'),
119 ],
120 'remember_length' => [
121 'type' => 'group',
122 'label' => __('Remember length', 'age-gate'),
123 'wrapper' => [
124 'class' => 'ag-field--flex',
125 ],
126 'condition' => [
127 'x-show' => 'remember != \'\'',
128 ],
129 'fields' => [
130 'remember_length' => [
131 'type' => 'number',
132 'default' => 365,
133 'attributes' => [
134 'class' => 'small-text',
135 ],
136 'label' => __('Remember length', 'age-gate'),
137 ],
138 'remember_time' => [
139 'type' => 'select',
140 'default' => 'days',
141 'options' => [
142 'days' => __('Days', 'age-gate'),
143 'hours' => __('Hours', 'age-gate'),
144 'minutes' => __('Minutes', 'age-gate'),
145 ],
146 'attributes' => [],
147 'label' => __('Remember time', 'age-gate'),
148 ],
149 ]
150 ],
151 'remember_auto_check' => [
152 'default' => false,
153 'type' => 'checkbox',
154 'attributes' => [],
155 'label' => __('Auto check remember me', 'age-gate'),
156 'condition' => [
157 'x-show' => 'remember != \'\'',
158 ],
159 ],
160 'ignore_logged' => [
161 'default' => false,
162 'type' => 'checkbox',
163 'attributes' => [],
164 'label' => __('Ignore logged in', 'age-gate'),
165 ],
166 'rechallenge' => [
167 'default' => true,
168 'type' => 'checkbox',
169 'attributes' => [],
170 'label' => __('Rechallenge', 'age-gate'),
171 ],
172 'redirect' => [
173 'type' => 'link',
174 'default' => null,
175 'attributes' => [],
176 'label' => __('Redirect failures ', 'age-gate'),
177 'translate' => true,
178 ],
179 ]
180 ],
181 ];
182 }
183 }
184