|
9 | 9 | defined('_JEXEC') or die; |
10 | 10 | extract($displayData); |
11 | 11 | $attrs = []; |
12 | | -$attrs[] = 'id="' . $field->id . '"'; |
| 12 | +$attrs[] = 'id="' . $field->name . '-' . $module->id . '"'; |
13 | 13 | if ($field->required) { |
14 | | - $attrs[] = 'required'; |
15 | | - if (isset($field->custom_error) && !empty(trim($field->custom_error))) { |
16 | | - $attrs[] = 'data-parsley-required-message="' . JText::sprintf($field->custom_error) . '"'; |
17 | | - } else { |
18 | | - $attrs[] = 'data-parsley-required-message="' . JText::sprintf('MOD_JDSCF_REQUIRED_ERROR', strip_tags($label)) . '"'; |
19 | | - } |
20 | | - } |
21 | | -$attrs[] = 'id="' . $field->name . '-file-input"'; |
22 | | -//fetching allowed types |
| 14 | + $attrs[] = 'required'; |
| 15 | + if (isset($field->custom_error) && !empty(trim($field->custom_error))) { |
| 16 | + $attrs[] = 'data-parsley-required-message="' . JText::sprintf($field->custom_error) . '"'; |
| 17 | + } else { |
| 18 | + $attrs[] = 'data-parsley-required-message="' . JText::sprintf('MOD_JDSCF_REQUIRED_ERROR', strip_tags($label)) . '"'; |
| 19 | + } |
| 20 | +} |
| 21 | + |
| 22 | +// fetching allowed types |
23 | 23 | $params = JComponentHelper::getParams('com_media'); |
24 | 24 | $allowable = array_map('trim', explode(',', $params->get('upload_extensions'))); |
25 | 25 | $allowedMaxSize = $params->get('upload_maxsize'); |
|
34 | 34 | $document->addStyleDeclaration($style); |
35 | 35 | ?> |
36 | 36 | <div class="custom-file"> |
37 | | - <input id="<?php echo $field->name; ?>-<?php echo $module->id; ?>" accept="<?php echo '.' . implode( ',.', $allowable ); ?>" type="file" name="jdscf[<?php echo $field->name; ?>]" class="custom-file-input" <?php echo implode(' ', $attrs); ?>> |
| 37 | + <input accept="<?php echo '.' . implode( ',.', $allowable ); ?>" type="file" name="jdscf[<?php echo $field->name; ?>]" class="custom-file-input" <?php echo implode(' ', $attrs); ?>> |
38 | 38 | <label class="custom-file-label" for="<?php echo $field->name; ?>-<?php echo $module->id; ?>"><?php echo JText::_('MOD_JDSCF_FILE_LBL'); ?></label> |
39 | 39 | </div> |
40 | 40 |
|
|
0 commit comments