-
Notifications
You must be signed in to change notification settings - Fork 0
/
client_services_package_options.pdt
71 lines (65 loc) · 3.33 KB
/
client_services_package_options.pdt
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
71
<div class="service_package_options">
<?php
if (($this->Html->ifSet($fields) && !empty($fields)) || $this->Html->ifSet($html) != '') {
foreach ($this->Html->ifSet($fields, []) as $field) {
if ($field->type != 'fieldHidden') {
?>
<div class="form-group">
<?php
}
// Draw the primary label/field
call_user_func_array([$this->Form, $field->type], $field->params);
// Draw each form field associated with this label
foreach ($field->fields as $input) {
// Display tooltip
if ($input->type == 'tooltip') {
?>
<a href="#" data-toggle="tooltip" data-html="true" title="<?php $this->Html->_($input->params['message']);?>"><i class="fas fa-question-circle text-info"></i></a>
<?php
continue;
}
// Draw the form field's secondary label if checkbox or radio item
if (($input->type == 'fieldCheckbox' || $input->type == 'fieldRadio') && isset($input->label)) {
$class = ($input->type == 'fieldRadio' ? 'radio' : 'checkbox');
?>
<div class="<?php $this->Html->_($class);?>">
<label<?php echo $this->Html->buildAttributes($input->label->params);?>>
<?php
call_user_func_array([$this->Form, $input->type], $input->params);
$this->Html->_($input->label->params['name']);
?>
</label>
</div>
<?php
} else {
// Set form field class
if (isset($input->params['attributes']['class'])) {
if (is_array($input->params['attributes']['class'])) {
$input->params['attributes']['class'][] = 'form-control';
} else {
$input->params['attributes']['class'] .= ' form-control';
}
} else {
$input->params['attributes']['class'] = 'form-control';
}
// Draw the form field
call_user_func_array([$this->Form, $input->type], $input->params);
// Show form field's secondary label
if (isset($input->label)) {
call_user_func_array([$this->Form, 'label'], $input->label->params);
}
}
}
if ($field->type != 'fieldHidden') {
?>
</div>
<?php
}
}
?>
<?php echo $this->Html->ifSet($html);?>
<div class="clearfix"></div>
<?php
}
?>
</div>