|
10 | 10 | extract($displayData); |
11 | 11 | $attrs = []; |
12 | 12 | if (isset($field->placeholder) && !empty($field->placeholder)) { |
13 | | - $attrs[] = 'placeholder="' . $field->placeholder . '"'; |
| 13 | + $attrs[] = 'placeholder="' . $field->placeholder . '"'; |
14 | 14 | } |
15 | 15 |
|
16 | 16 | if (!empty($field->id)) { |
17 | | - $attrs[] = 'id="' . $field->id . '"'; |
| 17 | + $attrs[] = 'id="' . $field->id . '"'; |
18 | 18 | } |
19 | 19 |
|
20 | 20 | if ($field->required) { |
21 | | - $attrs[] = 'required'; |
22 | | - $attrs[] = 'data-parsley-required-message="' . JText::sprintf('MOD_JDSCF_REQUIRED_ERROR', strip_tags($label)) . '"'; |
| 21 | + $attrs[] = 'required'; |
| 22 | + if (!empty(trim($field->custom_error))) { |
| 23 | + $attrs[] = 'data-parsley-required-message="' . JText::sprintf($field->custom_error) . '"'; |
| 24 | + } else { |
| 25 | + $attrs[] = 'data-parsley-required-message="' . JText::sprintf('MOD_JDSCF_REQUIRED_ERROR', strip_tags($label)) . '"'; |
| 26 | + } |
23 | 27 | } |
24 | 28 |
|
25 | 29 | $document = JFactory::getDocument(); |
26 | 30 | $style = 'label.calendar_icon {' |
27 | | - . 'display: inherit;' |
28 | | - . 'cursor: pointer;' |
29 | | - . 'margin: 0px;' |
30 | | - . 'border-radius: 0;' |
31 | | - . '}'; |
| 31 | + . 'display: inherit;' |
| 32 | + . 'cursor: pointer;' |
| 33 | + . 'margin: 0px;' |
| 34 | + . 'border-radius: 0;' |
| 35 | + . '}'; |
32 | 36 | $document->addStyleDeclaration($style); |
33 | 37 | ?> |
34 | 38 |
|
|
45 | 49 |
|
46 | 50 | <?php |
47 | 51 | $js = 'var jdscf_picker_' . $module->id . ' = new Pikaday({' |
48 | | - . 'field: document.getElementById("' . $field->id . '")'; |
| 52 | +. 'field: document.getElementById("' . $field->id . '")'; |
49 | 53 | if (isset($field->calendar_min) && !empty($field->calendar_min) && $field->calendar_min != '0000-00-00 00:00:00') { |
50 | | - $js .= ',minDate: moment("' . $field->calendar_min . '").toDate()'; |
| 54 | + $js .= ',minDate: moment("' . $field->calendar_min . '").toDate()'; |
51 | 55 | } |
52 | 56 | if (isset($field->calendar_max) && !empty($field->calendar_max) && $field->calendar_max != '0000-00-00 00:00:00') { |
53 | | - $js .= ',maxDate: moment("' . $field->calendar_max . '").toDate()'; |
| 57 | + $js .= ',maxDate: moment("' . $field->calendar_max . '").toDate()'; |
54 | 58 | } |
55 | 59 | if (isset($field->calendar_format) && !empty($field->calendar_format)) { |
56 | | - $js .= ',format: "' . $field->calendar_format . '"'; |
| 60 | + $js .= ',format: "' . $field->calendar_format . '"'; |
57 | 61 | } else { |
58 | | - $js .= ',format: "MM-DD-YYYY"'; |
| 62 | + $js .= ',format: "MM-DD-YYYY"'; |
59 | 63 | } |
60 | 64 |
|
61 | 65 | $js .= ',defaultDate: moment("' . date('Y-m-d') . '").toDate(),setDefaultDate:true'; |
|
0 commit comments