Form
last analyzed

Complexity

Total Complexity 0

Size/Duplication

Total Lines 197
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 0
lcom 0
cbo 1
dl 0
loc 197
c 0
b 0
f 0
1
<?php
2
namespace Redaxscript\Admin\Html;
3
4
use Redaxscript\Html\Form as BaseForm;
5
6
/**
7
 * children class to create a admin form
8
 *
9
 * @since 3.0.0
10
 *
11
 * @package Redaxscript
12
 * @category Html
13
 * @author Henry Ruhs
14
 *
15
 * @method $this create(string $text = null, array $attributeArray = [])
16
 * @method $this delete(string $text = null, array $attributeArray = [])
17
 * @method $this save(string $text = null, array $attributeArray = [])
18
 * @method $this uninstall(string $text = null, array $attributeArray = [])
19
 */
20
21
class Form extends BaseForm
22
{
23
	/**
24
	 * languages of the form
25
	 *
26
	 * @var array
27
	 */
28
29
	protected $_languageArray =
30
	[
31
		'legend' => 'fields_required',
32
		'button' =>
33
		[
34
			'button' => 'ok',
35
			'create' => 'create',
36
			'reset' => 'reset',
37
			'save' => 'save',
38
			'submit' => 'submit'
39
		],
40
		'link' =>
41
		[
42
			'cancel' => 'cancel',
43
			'delete' => 'delete',
44
			'uninstall' => 'uninstall'
45
		]
46
	];
47
48
	/**
49
	 * attributes of the form
50
	 *
51
	 * @var array
52
	 */
53
54
	protected $_attributeArray =
55
	[
56
		'form' =>
57
		[
58
			'class' => 'rs-admin-js-validate rs-admin-form-default',
59
			'method' => 'post'
60
		],
61
		'legend' =>
62
		[
63
			'class' => 'rs-admin-legend-default'
64
		],
65
		'label' =>
66
		[
67
			'class' => 'rs-admin-label-default'
68
		],
69
		'select' =>
70
		[
71
			'class' => 'rs-admin-field-select'
72
		],
73
		'textarea' =>
74
		[
75
			'class' => 'rs-admin-js-resize rs-admin-field-textarea',
76
			'cols' => 100,
77
			'rows' => 5
78
		],
79
		'input' =>
80
		[
81
			'checkbox' =>
82
			[
83
				'class' => 'rs-admin-field-checkbox',
84
				'type' => 'checkbox'
85
			],
86
			'color' =>
87
			[
88
				'class' => 'rs-admin-field-color',
89
				'type' => 'color'
90
			],
91
			'date' =>
92
			[
93
				'class' => 'rs-admin-field-default rs-admin-field-date',
94
				'type' => 'date'
95
			],
96
			'datetime' =>
97
			[
98
				'class' => 'rs-admin-field-default rs-admin-field-date',
99
				'type' => 'datetime-local'
100
			],
101
			'email' =>
102
			[
103
				'class' => 'rs-admin-field-default rs-admin-field-email',
104
				'type' => 'email'
105
			],
106
			'file' =>
107
			[
108
				'class' => 'rs-admin-field-file',
109
				'type' => 'file'
110
			],
111
			'hidden' =>
112
			[
113
				'class' => 'rs-admin-field-hidden',
114
				'type' => 'hidden'
115
			],
116
			'number' =>
117
			[
118
				'class' => 'rs-admin-field-default rs-admin-field-number',
119
				'type' => 'number'
120
			],
121
			'password' =>
122
			[
123
				'class' => 'rs-admin-field-default rs-admin-field-password',
124
				'type' => 'password'
125
			],
126
			'radio' =>
127
			[
128
				'class' => 'rs-admin-field-radio',
129
				'type' => 'radio'
130
			],
131
			'range' =>
132
			[
133
				'class' => 'rs-admin-field-range',
134
				'type' => 'range'
135
			],
136
			'search' =>
137
			[
138
				'class' => 'rs-admin-js-search rs-admin-field-search',
139
				'type' => 'search'
140
			],
141
			'tel' =>
142
			[
143
				'class' => 'rs-admin-field-default rs-admin-field-tel',
144
				'type' => 'tel'
145
			],
146
			'time' =>
147
			[
148
				'class' => 'rs-admin-field-default rs-admin-field-date',
149
				'type' => 'time'
150
			],
151
			'text' =>
152
			[
153
				'class' => 'rs-admin-field-default rs-admin-field-default',
154
				'type' => 'text'
155
			],
156
			'url' =>
157
			[
158
				'class' => 'rs-admin-field-default rs-admin-field-url',
159
				'type' => 'url'
160
			],
161
			'week' =>
162
			[
163
				'class' => 'rs-admin-field-default rs-admin-field-date',
164
				'type' => 'week'
165
			]
166
		],
167
		'button' =>
168
		[
169
			'button' =>
170
			[
171
				'class' => 'rs-admin-js-button rs-admin-button-default rs-admin-button-large',
172
				'type' => 'button'
173
			],
174
			'reset' =>
175
			[
176
				'class' => 'rs-admin-js-reset rs-admin-button-default rs-admin-button-reset rs-admin-button-large',
177
				'type' => 'reset'
178
			],
179
			'submit' =>
180
			[
181
				'class' => 'rs-admin-js-submit rs-admin-button-default rs-admin-button-submit rs-admin-button-large',
182
				'type' => 'submit',
183
				'value' => 'submit'
184
			],
185
			'save' =>
186
			[
187
				'class' => 'rs-admin-js-save rs-admin-button-default rs-admin-button-save rs-admin-button-large',
188
				'name' => 'edit',
189
				'type' => 'submit',
190
				'value' => 'update'
191
			],
192
			'create' =>
193
			[
194
				'class' => 'rs-admin-js-create rs-admin-button-default rs-admin-button-create rs-admin-button-large',
195
				'name' => 'new',
196
				'type' => 'submit',
197
				'value' => 'create'
198
			]
199
		],
200
		'link' =>
201
		[
202
			'cancel' =>
203
			[
204
				'class' => 'rs-admin-js-cancel rs-admin-button-default rs-admin-button-cancel rs-admin-button-large',
205
				'href' => 'javascript:history.back()'
206
			],
207
			'delete' =>
208
			[
209
				'class' => 'rs-admin-js-delete rs-admin-button-default rs-admin-button-delete rs-admin-button-large'
210
			],
211
			'uninstall' =>
212
			[
213
				'class' => 'rs-admin-js-uninstall rs-admin-button-default rs-admin-button-uninstall rs-admin-button-large'
214
			]
215
		]
216
	];
217
}
218