Skip to content

Commit

Permalink
LegacyUI: Add Label to FileUpload Input
Browse files Browse the repository at this point in the history
  • Loading branch information
kergomard committed Dec 13, 2024
1 parent 2ef08fd commit b796a48
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions Services/Form/classes/class.ilFileInputGUI.php
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,7 @@ public function render(string $a_mode = ""): string
$f_tpl->setVariable("POST_VAR", $this->getPostVar());
$f_tpl->setVariable("ID", $this->getFieldId());
$f_tpl->setVariable("SIZE", $this->getSize());
$f_tpl->setVariable("LABEL_SELECTED_FILES_INPUT", $this->lng->txt('selected_files'));


/* experimental: bootstrap'ed file upload */
Expand Down
2 changes: 1 addition & 1 deletion Services/Form/classes/class.ilImageFileInputGUI.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ public function insert(ilTemplate $a_tpl): void
$i_tpl->setVariable('MAX_SIZE', $this->upload_limit->getPhpUploadLimitInBytes());
$i_tpl->setVariable("POST_VAR", $this->getPostVar());
$i_tpl->setVariable("ID", $this->getFieldId());

$i_tpl->setVariable("LABEL_SELECTED_FILES_INPUT", $this->lng->txt('selected_files'));

/* experimental: bootstrap'ed file upload */
$i_tpl->setVariable("TXT_BROWSE", $lng->txt("select_file"));
Expand Down
3 changes: 2 additions & 1 deletion Services/Form/templates/default/tpl.prop_file.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
{TXT_BROWSE}<input type="file" id="{ID}" name="{POST_VAR}" data-maxsize="{MAX_SIZE}" data-maxsize-warning="{MAX_SIZE_WARNING}"{DISABLED}/>
</span>
</span>
<input tabindex="-1" type="text" class="form-control" readonly="readonly"{DISABLED}>
<label class='sr-only' for="{POST_VAR}_file_display">{LABEL_SELECTED_FILES_INPUT}</label>
<input tabindex="-1" id="{POST_VAR}_file_display" type="text" class="form-control" readonly="readonly"{DISABLED}>
</div>

<!--<input type="file" id="{ID}" name="{POST_VAR}" size="{SIZE}" data-maxsize="{MAX_SIZE}" data-maxsize-warning="{MAX_SIZE_WARNING}"{DISABLED} />-->
Expand Down
3 changes: 2 additions & 1 deletion Services/Form/templates/default/tpl.prop_image_file.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
{TXT_BROWSE}<input type="file" id="{ID}" name="{POST_VAR}" data-maxsize="{MAX_SIZE}" data-maxsize-warning="{MAX_SIZE_WARNING}"{DISABLED}/>
</span>
</span>
<input tabindex="-1" type="text" class="form-control" readonly="readonly"{DISABLED}>
<label class='sr-only' for="{POST_VAR}_file_display">{LABEL_SELECTED_FILES_INPUT}</label>
<input tabindex="-1" id="{POST_VAR}_file_display" type="text" class="form-control" readonly="readonly"{DISABLED}>
</div>

<!--<input type="file" id="{ID}" name="{POST_VAR}" size="30" {DISABLED}/>-->
Expand Down

0 comments on commit b796a48

Please sign in to comment.