[BUGFIX] Add requireJs for Inline JavaScript in file replace view
[Packages/TYPO3.CMS.git] / typo3 / sysext / backend / Resources / Private / Templates / File / ReplaceFile.html
1 <h1><f:translate key="LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:file_replace.php.pagetitle" /></h1>
2 <div>
3 <form action="{moduleUrlTceFile}" role="form" method="post" name="editform" enctype="multipart/form-data">
4 <div class="form-group">
5 <input type="checkbox" value="1" id="keepFilename" name="data[replace][1][keepFilename]">
6 <label for="keepFilename"><f:translate key="LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:file_replace.php.keepfiletitle" /></label>
7 </div>
8
9 <div class="form-group">
10 <label for="file_replace"><f:translate key="LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:file_replace.php.selectfile" /></label>
11 <div class="input-group col-xs-6">
12 <input type="text" name="fakefile" id="fakefile" class="form-control input-xlarge" readonly>
13 <a class="input-group-addon btn btn-primary" onclick="$('#file_replace').click();">
14 <f:translate key="LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:file_replace.php.browse" />
15 </a>
16 </div>
17 <input class="form-control" type="file" id="file_replace" name="replace_1" style="visibility: hidden;" />
18 </div>
19
20 <script>
21 require(['jquery'], function($) {
22 $('#file_replace').change(function() {
23 $('#fakefile').val($(this).val());
24 });
25 });
26 </script>
27
28 <input type="hidden" name="overwriteExistingFiles" value="replace" />
29 <input type="hidden" name="data[replace][1][data]" value="1" />
30 <input type="hidden" name="data[replace][1][uid]" value="{uid}" />
31
32 <div class="form-group">
33 <input class="btn btn-primary" type="submit" value="{f:translate(key: 'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:file_replace.php.submit')}" />
34 <input class="btn btn-danger" type="submit" value="{f:translate(key: 'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.cancel')}"
35 onclick="backToList(); return false;" />
36 <input type="hidden" name="data[replace][1][redirect]" value="{returnUrl}" />
37 </div>
38 </form>
39 </div>