Newer
Older
* Copyright (C) 2020 Leipzig University Library
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* @author Sebastian Kehr <kehr@ub.uni-leipzig.de>
* @license http://opensource.org/licenses/gpl-2.0.php GNU GPLv2
*/
use Laminas\Filter\Boolean;
use Laminas\Form\Element\Checkbox;
use Laminas\Form\Element\Hidden;
use Laminas\Form\Element\Select;
use Laminas\Form\Element\Text;
use Laminas\Form\Fieldset;
use Laminas\Validator\NotEmpty;
return [
'validation_group' => [
'data' => [
'newsletter',
'deleted'
],
],
'elements' => [
'job_title' => [
'spec' => [
'type' => Select::class,
'options' => [
'value_options' => [
'job_title_2',
'job_title_3',
'job_title_4',
'job_title_5',
'job_title_6',
'job_title_7',
'job_title_8',
'job_title_9',
],
],
],
],
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
'addresses' => [
'spec' => [
'elements' => [
'address_0' => [
'spec' => [
'options' => [
'label' => 'label_address_0',
'template' => 'fid/user/office-address-fieldset.phtml',
],
],
],
'address_1' => [
'spec' => [
'name' => 1,
'type' => Fieldset::class,
'options' => [
'label' => 'label_address_1',
'template' => 'fid/user/home-address-fieldset.phtml',
],
'elements' => [
'id' => [
'spec' => [
'name' => 'id',
'type' => Hidden::class,
],
],
'line1' => [
'spec' => [
'name' => 'line1',
'options' => [
'label' => 'label_address_1_line_1',
],
'attributes' => [
'readonly' => true,
],
],
],
'line2' => [
'spec' => [
'name' => 'line2',
'options' => [
'label' => 'label_address_1_line_2',
],
'attributes' => [
'readonly' => true,
],
],
],
'zip' => [
'spec' => [
'name' => 'zip',
'options' => [
'label' => 'label_address_1_zip',
],
'attributes' => [
'readonly' => true,
],
],
],
'city' => [
'spec' => [
'name' => 'city',
'options' => [
'label' => 'label_address_1_city',
],
'attributes' => [
'readonly' => true,
],
],
],
'country' => [
'spec' => [
'name' => 'country',
'options' => [
'label' => 'label_address_1_country',
],
'attributes' => [
'readonly' => true,
],
],
],
],
],
],
],
],
],
'data' => [
'spec' => [
'elements' => [
'phone' => [
'spec' => [
'name' => 'phone',
'type' => Text::class,
'options' => [
'label' => 'label_phone',
],
'attributes' => [
'readonly' => true,
],
],
],
'newsletter' => [
'spec' => [
'name' => 'newsletter',
'type' => Checkbox::class,
'options' => [
'label' => 'label_newsletter',
],
],
],
'deleted' => [
'spec' => [
'name' => 'deleted',
'type' => Checkbox::class,
'options' => [
'label' => 'label_deleted',
],
],
],
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
'delivery_address' => [
'spec' => [
'name' => 'delivery_address',
'type' => Checkbox::class,
'options' => [
'label' => 'label_delivery_address',
],
'attributes' => [
'disabled' => true,
],
],
],
],
'options' => [
'input_filter_spec' => [
'newsletter' => [
'name' => 'newsletter',
'filters' => [
Boolean::class => [
'name' => Boolean::class,
],
],
'validators' => [
NotEmpty::class => [
'name' => NotEmpty::class,
'options' => [
'type' => NotEmpty::NULL,
],
],
],
],
'deleted' => [
'name' => 'deleted',
'filters' => [
Boolean::class => [
'name' => Boolean::class,
],
],
'validators' => [
NotEmpty::class => [
'name' => NotEmpty::class,
'options' => [
'type' => NotEmpty::NULL,
],
],
],
],
],
],
],
],