Newer
Older
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
<div id="file_edit_window">
<?= $aside_template->render() ?>
<div id="file_management_forms">
<form method="post" data-dialog class="default"
action="<?= $controller->link_for('/edit/' . $file->getId()) ?>">
<?= CSRFProtection::tokenTag() ?>
<fieldset>
<legend><?= _('Datei bearbeiten') ?></legend>
<label>
<?= _('Name') ?>
<input id="edit_file_name" type="text" name="name"
value="<?= htmlReady($name) ?>">
</label>
</fieldset>
<footer data-dialog-button>
<?= Studip\Button::createAccept(_('Speichern'), 'save') ?>
<?= Studip\LinkButton::createCancel(
_('Abbrechen'),
$controller->url_for((in_array($folder->range_type, ['course', 'institute']) ? $folder->range_type . '/' : '') . 'files/index/' . $folder->id)
) ?>
</footer>
</form>
</div>
</div>
<script>
//On focus on the edit file name input field, the whole file name but the
//extension shall be selected. This can't be done with jQuery directly!
jQuery('#edit_file_name').focus(function() {
//select the whole file name, but the file extension
var text = $(this).val(),
//get start position of extension:
extension_start_pos = text.lastIndexOf('.');
$(this).setSelection(0, extension_start_pos);
});
</script>