Use `jslang` in more places
[GitHub/WoltLab/WCF.git] / wcfsetup / install / files / acp / templates / dataImport.tpl
CommitLineData
78db8ddf
MW
1{include file='header' pageTitle='wcf.acp.dataImport'}
2
9543d9fe 3<script data-relocate="true">
78db8ddf
MW
4 $(function() {
5 {if $queue|isset}
6 WCF.Language.addObject({
e2e8c155
MW
7 'wcf.acp.dataImport': '{jslang}wcf.acp.dataImport{/jslang}',
8 'wcf.acp.dataImport.completed': '{jslang}wcf.acp.dataImport.completed{/jslang}',
9 {implode from=$importers item=importer}'wcf.acp.dataImport.data.{@$importer}': '{jslang}wcf.acp.dataImport.data.{@$importer}{/jslang}'{/implode}
78db8ddf
MW
10 });
11
971fbab8 12 var $queues = [ {implode from=$queue item=item}'{@$item}'{/implode} ];
7b5e9bab 13 new WCF.ACP.Import.Manager($queues, '{link controller='RebuildData' encode=false}{/link}');
78db8ddf
MW
14 {/if}
15
16 $('.jsImportSection').change(function(event) {
17 var $section = $(event.currentTarget);
a1c64bf6 18
78db8ddf
MW
19 if ($section.is(':checked')) {
20 $section.parent().next().find('input[type=checkbox]').prop('checked', 'checked');
21 }
22 else {
23 $section.parent().next().find('input[type=checkbox]').prop('checked', false);
24 }
25 });
db31a624 26
78db8ddf
MW
27 $('.jsImportItem').change(function(event) {
28 var $item = $(event.currentTarget);
29 if ($item.is(':checked')) {
30 $item.parents('.jsImportCollection').find('.jsImportSection').prop('checked', 'checked');
31 }
78db8ddf
MW
32 });
33 });
78db8ddf
MW
34</script>
35
95961bdf 36<header class="contentHeader">
b5c94e9e
AE
37 <div class="contentHeaderTitle">
38 <h1 class="contentTitle">{lang}wcf.acp.dataImport{/lang}</h1>
39 {if $exporterName}
40 <p class="contentHeaderDescription">{lang}wcf.acp.dataImport.exporter.{@$exporterName}{/lang}</p>
41 {/if}
42 </div>
43
44 {hascontent}
45 <nav class="contentHeaderNavigation">
46 <ul>
47 {content}{event name='contentHeaderNavigation'}{/content}
48 </ul>
49 </nav>
50 {/hascontent}
78db8ddf
MW
51</header>
52
ee629b22 53{include file='formError'}
78db8ddf 54
78db8ddf
MW
55{if !$exporterName}
56 {if !$availableExporters|count}
57 <p class="info">{lang}wcf.acp.dataImport.selectExporter.noExporters{/lang}</p>
58 {else}
3bbdfdb0
AE
59 {if $showMappingNotice}
60 <p class="warning">{lang}wcf.acp.dataImport.existingMapping.notice{/lang}</p>
61 <script data-relocate="true">
3bbdfdb0
AE
62 $(function() {
63 $('#deleteMapping').click(function() {
9f663473 64 WCF.System.Confirmation.show('{jslang}wcf.acp.dataImport.existingMapping.confirmMessage{/jslang}', function(action) {
3bbdfdb0
AE
65 if (action === 'confirm') {
66 new WCF.Action.Proxy({
67 autoSend: true,
68 data: {
69 actionName: 'resetMapping',
70 className: 'wcf\\system\\importer\\ImportHandler'
71 },
72 success: function() { window.location.reload(); },
772f616f 73 url: 'index.php/AJAXInvoke/?t=' + SECURITY_TOKEN
3bbdfdb0
AE
74 });
75 }
76 });
77
78 return false;
79 });
80 });
3bbdfdb0
AE
81 </script>
82 {/if}
83
909b697f 84 <form method="post" action="{link controller='DataImport'}{/link}">
95961bdf
MW
85 <section class="section">
86 <h2 class="sectionTitle">{lang}wcf.acp.dataImport.selectExporter{/lang}</h2>
87
88 <dl{if $errorField == 'exporterName'} class="formError"{/if}>
89 <dt><label for="exporterName">{lang}wcf.acp.dataImport.exporter{/lang}</label></dt>
90 <dd>
91 <select name="exporterName" id="exporterName">
92 {foreach from=$availableExporters key=availableExporterName item=availableExporter}
93 <option value="{@$availableExporterName}">{lang}wcf.acp.dataImport.exporter.{@$availableExporterName}{/lang}</option>
94 {/foreach}
95 </select>
96 {if $errorField == 'exporterName'}
97 <small class="innerError">
98 {if $errorType == 'empty'}
99 {lang}wcf.global.form.error.empty{/lang}
100 {else}
101 {lang}wcf.acp.dataImport.exporterName.error.{@$errorType}{/lang}
102 {/if}
103 </small>
104 {/if}
105 </dd>
106 </dl>
107
108 {event name='selectExporterFields'}
109 </section>
2d63c13c 110
78db8ddf 111 <div class="formSubmit">
e5f9b56c
MW
112 <input type="submit" value="{lang}wcf.global.button.submit{/lang}" accesskey="s">
113 <input type="hidden" name="sourceSelection" value="1">
7b91d834 114 {@SECURITY_TOKEN_INPUT_TAG}
78db8ddf
MW
115 </div>
116 </form>
117 {/if}
118{else}
119 <form method="post" action="{link controller='DataImport'}{/link}">
95961bdf
MW
120 <section class="section">
121 <header class="sectionHeader">
122 <h2 class="sectionTitle">{lang}wcf.acp.dataImport.configure.data{/lang}</h2>
114b5320 123 <p class="sectionDescription">{lang}wcf.acp.dataImport.configure.data.description{/lang}</p>
95961bdf 124 </header>
78db8ddf 125
95961bdf
MW
126 {foreach from=$supportedData key=objectTypeName item=objectTypes}
127 <dl class="wide">
128 <dt></dt>
129 <dd class="jsImportCollection">
6f2bc235 130 <label><input type="checkbox" name="selectedData[]" value="{@$objectTypeName}" class="jsImportSection"{if $objectTypeName|in_array:$selectedData} checked{/if}> {lang}wcf.acp.dataImport.data.{@$objectTypeName}{/lang}</label>
95961bdf
MW
131 <p>
132 {foreach from=$objectTypes item=objectTypeName}
6f2bc235 133 <label><input type="checkbox" name="selectedData[]" value="{@$objectTypeName}" class="jsImportItem"{if $objectTypeName|in_array:$selectedData} checked{/if}> {lang}wcf.acp.dataImport.data.{@$objectTypeName}{/lang}</label>
95961bdf
MW
134 {/foreach}
135 </p>
187c9504
MW
136 </dd>
137 </dl>
95961bdf 138 {/foreach}
78db8ddf 139
95961bdf
MW
140 {event name='dataFields'}
141 </section>
142
143 <section class="section">
144 <h2 class="sectionTitle">{lang}wcf.acp.dataImport.configure.settings{/lang}</h2>
78db8ddf 145
95961bdf
MW
146 <dl>
147 <dt><label for="userMergeMode">{lang}wcf.acp.dataImport.configure.settings.userMergeMode{/lang}</label></dt>
148 <dd>
6f2bc235
MW
149 <label><input type="radio" id="userMergeMode" name="userMergeMode" value="4"{if $userMergeMode == 4} checked{/if}> {lang}wcf.acp.dataImport.configure.settings.userMergeMode.4{/lang}</label>
150 <label><input type="radio" name="userMergeMode" value="5"{if $userMergeMode == 5} checked{/if}> {lang}wcf.acp.dataImport.configure.settings.userMergeMode.5{/lang}</label>
95961bdf
MW
151 </dd>
152 </dl>
187c9504 153
95961bdf
MW
154 {event name='settingFields'}
155 </section>
156
157 <section class="section{if $errorField == 'database'} formError{/if}">
158 <h2 class="sectionTitle">{lang}wcf.acp.dataImport.configure.database{/lang}</h2>
159
160 <dl>
161 <dt><label for="dbHost">{lang}wcf.acp.dataImport.configure.database.host{/lang}</label></dt>
162 <dd>
e5f9b56c 163 <input type="text" id="dbHost" name="dbHost" value="{$dbHost}" class="long">
95961bdf
MW
164 </dd>
165 </dl>
166
167 <dl>
168 <dt><label for="dbUser">{lang}wcf.acp.dataImport.configure.database.user{/lang}</label></dt>
169 <dd>
e5f9b56c 170 <input type="text" id="dbUser" name="dbUser" value="{$dbUser}" class="medium">
95961bdf
MW
171 </dd>
172 </dl>
173
174 <dl>
175 <dt><label for="dbPassword">{lang}wcf.acp.dataImport.configure.database.password{/lang}</label></dt>
176 <dd>
e5f9b56c 177 <input type="password" id="dbPassword" name="dbPassword" value="{$dbPassword}" class="medium" autocomplete="off">
95961bdf
MW
178 </dd>
179 </dl>
180
181 <dl>
182 <dt><label for="dbName">{lang}wcf.acp.dataImport.configure.database.name{/lang}</label></dt>
183 <dd>
e5f9b56c 184 <input type="text" id="dbName" name="dbName" value="{$dbName}" class="medium">
95961bdf
MW
185 </dd>
186 </dl>
187
188 <dl>
189 <dt><label for="dbPrefix">{lang}wcf.acp.dataImport.configure.database.prefix{/lang}</label></dt>
190 <dd>
e5f9b56c 191 <input type="text" id="dbPrefix" name="dbPrefix" value="{$dbPrefix}" class="short">
95961bdf
MW
192 {if $errorField == 'database'}
193 <small class="innerError">{lang}wcf.acp.dataImport.configure.database.error{/lang}</small>
194 {/if}
195 </dd>
196 </dl>
197
198 {event name='databaseFields'}
199 </section>
200
201 <section class="section">
202 <h2 class="sectionTitle">{lang}wcf.acp.dataImport.configure.fileSystem{/lang}</h2>
203
204 <dl{if $errorField == 'fileSystemPath'} class="formError"{/if}>
205 <dt><label for="fileSystemPath">{lang}wcf.acp.dataImport.configure.fileSystem.path{/lang}</label></dt>
206 <dd>
e5f9b56c 207 <input type="text" id="fileSystemPath" name="fileSystemPath" value="{$fileSystemPath}" class="long">
95961bdf
MW
208 {if $errorField == 'fileSystemPath'}
209 <small class="innerError">{lang}wcf.acp.dataImport.configure.fileSystem.path.error{/lang}</small>
210 {/if}
211 <small>{lang}wcf.acp.dataImport.configure.fileSystem.path.description{/lang}</small>
212 </dd>
213 </dl>
214
215 {event name='fileSystemFields'}
216 </section>
217
218 {event name='sections'}
2d63c13c 219
78db8ddf 220 <div class="formSubmit">
e5f9b56c
MW
221 <input type="hidden" name="exporterName" value="{$exporterName}">
222 <input type="submit" value="{lang}wcf.global.button.submit{/lang}" accesskey="s">
ee629b22 223 {@SECURITY_TOKEN_INPUT_TAG}
78db8ddf
MW
224 </div>
225 </form>
226{/if}
227
228{include file='footer'}