Completed
Push — master ( afa14d...f0d99a )
by Iman
13s
created

SettingsForm::makeForm()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 33
Code Lines 15

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 15
nc 1
nop 1
dl 0
loc 33
c 0
b 0
f 0
cc 1
rs 8.8571
1
<?php
2
3
namespace crocodicstudio\crudbooster\Modules\SettingModule;
4
5
class SettingsForm
6
{
7
    public static function makeForm($value)
8
    {
9
        $form = [];
10
11
        $form[] = ['label' => 'Group', 'name' => 'group_setting', 'value' => $value];
12
        $form[] = ['label' => 'Label', 'name' => 'label'];
13
14
        $form[] = [
15
            'label' => 'type',
16
            'name' => "content_input_type",
17
            'type' => "select_dataenum",
18
            'options' => ["enum" => ["text", "number", "email", "textarea", "wysiwyg", "upload_image", "upload_document", "datepicker", "radio", "select"]],
19
        ];
20
        $form[] = [
21
            'label' => "Radio / Select Data",
22
            'name' => 'dataenum',
23
            "placeholder" => "Example : abc,def,ghi",
24
            "jquery" => "
25
			function show_radio_data() {
26
				var cit = $('#content_input_type').val();
27
				if(cit == 'radio' || cit == 'select') {
28
					$('#form-group-dataenum').show();	
29
				}else{
30
					$('#form-group-dataenum').hide();
31
				}					
32
			}
33
			$('#content_input_type').change(show_radio_data);
34
			show_radio_data();
35
			",
36
        ];
37
        $form[] = ['label' => "Helper Text", 'name' => "helper", 'type' => "text"];
38
39
        return $form;
40
    }
41
}