1 | {combine_script id='common' load='footer' path='admin/themes/default/js/common.js'} |
---|
2 | |
---|
3 | {combine_script id='jquery.dataTables' load='footer' path='themes/default/js/plugins/jquery.dataTables.js'} |
---|
4 | {combine_css path="themes/default/js/plugins/datatables/css/jquery.dataTables.css"} |
---|
5 | |
---|
6 | {combine_script id='jquery.chosen' load='footer' path='themes/default/js/plugins/chosen.jquery.min.js'} |
---|
7 | {combine_css path="themes/default/js/plugins/chosen.css"} |
---|
8 | |
---|
9 | {combine_script id='jquery.ui.slider' require='jquery.ui' load='footer' path='themes/default/js/ui/minified/jquery.ui.slider.min.js'} |
---|
10 | {combine_css path="themes/default/js/ui/theme/jquery.ui.slider.css"} |
---|
11 | |
---|
12 | {footer_script} |
---|
13 | var selectedMessage_pattern = "{'%d of %d photos selected'|@translate}"; |
---|
14 | var selectedMessage_none = "{'No photo selected, %d photos in current set'|@translate}"; |
---|
15 | var selectedMessage_all = "{'All %d photos are selected'|@translate}"; |
---|
16 | var applyOnDetails_pattern = "{'on the %d selected users'|@translate}"; |
---|
17 | var newUser_pattern = "✔ {'User %s added'|translate}"; |
---|
18 | var registeredOn_pattern = "{'Registered on %s, %s.'|translate}"; |
---|
19 | var lastVisit_pattern = "{'Last visit on %s, %s.'|translate}"; |
---|
20 | var missingConfirm = "{'You need to confirm deletion'|translate}"; |
---|
21 | var missingUsername = "{'Please, enter a login'|translate}"; |
---|
22 | |
---|
23 | var allUsers = [{$all_users}]; |
---|
24 | var selection = [{$selection}]; |
---|
25 | var pwg_token = "{$PWG_TOKEN}"; |
---|
26 | |
---|
27 | var truefalse = { |
---|
28 | true:"{'Yes'|translate}", |
---|
29 | false:"{'No'|translate}", |
---|
30 | }; |
---|
31 | {/footer_script} |
---|
32 | |
---|
33 | {footer_script}{literal} |
---|
34 | jQuery(document).ready(function() { |
---|
35 | /** |
---|
36 | * Add user |
---|
37 | */ |
---|
38 | jQuery("#addUser").click(function() { |
---|
39 | jQuery("#addUserForm").toggle(); |
---|
40 | jQuery("#showAddUser .infos").hide(); |
---|
41 | jQuery("input[name=username]").focus(); |
---|
42 | return false; |
---|
43 | }); |
---|
44 | |
---|
45 | jQuery("#addUserClose").click(function() { |
---|
46 | jQuery("#addUserForm").hide(); |
---|
47 | return false; |
---|
48 | }); |
---|
49 | |
---|
50 | jQuery("#addUserForm").submit(function() { |
---|
51 | jQuery.ajax({ |
---|
52 | url: "ws.php?format=json&method=pwg.users.add", |
---|
53 | type:"POST", |
---|
54 | data: jQuery(this).serialize(), |
---|
55 | beforeSend: function() { |
---|
56 | jQuery("#addUserForm .errors").hide(); |
---|
57 | |
---|
58 | if (jQuery("input[name=username]").val() == "") { |
---|
59 | jQuery("#addUserForm .errors").html('✘ '+missingUsername).show(); |
---|
60 | return false; |
---|
61 | } |
---|
62 | |
---|
63 | jQuery("#addUserForm .loading").show(); |
---|
64 | }, |
---|
65 | success:function(data) { |
---|
66 | oTable.fnDraw(); |
---|
67 | jQuery("#addUserForm .loading").hide(); |
---|
68 | |
---|
69 | var data = jQuery.parseJSON(data); |
---|
70 | if (data.stat == 'ok') { |
---|
71 | jQuery("#addUserForm input[type=text], #addUserForm input[type=password]").val(""); |
---|
72 | |
---|
73 | var new_user = data.result.users[0]; |
---|
74 | allUsers.push(parseInt(new_user.id)); |
---|
75 | jQuery("#showAddUser .infos").html(sprintf(newUser_pattern, new_user.username)).show(); |
---|
76 | checkSelection(); |
---|
77 | |
---|
78 | jQuery("#addUserForm").hide(); |
---|
79 | } |
---|
80 | else { |
---|
81 | jQuery("#addUserForm .errors").html('✘ '+data.message).show(); |
---|
82 | } |
---|
83 | }, |
---|
84 | error:function(XMLHttpRequest, textStatus, errorThrows) { |
---|
85 | jQuery("#addUserForm .loading").hide(); |
---|
86 | } |
---|
87 | }); |
---|
88 | |
---|
89 | return false; |
---|
90 | }); |
---|
91 | |
---|
92 | /** |
---|
93 | * Table with users |
---|
94 | */ |
---|
95 | /** |
---|
96 | * find the key from a value in the startStopValues array |
---|
97 | */ |
---|
98 | function getSliderKeyFromValue(value, values) { |
---|
99 | for (var key in values) { |
---|
100 | if (values[key] >= value) { |
---|
101 | return key; |
---|
102 | } |
---|
103 | } |
---|
104 | return 0; |
---|
105 | } |
---|
106 | |
---|
107 | var recent_period_values = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,25,30,40,50,60,80,99]; |
---|
108 | |
---|
109 | function getRecentPeriodInfoFromIdx(idx) { |
---|
110 | return sprintf( |
---|
111 | "{/literal}{'%d days'|@translate}{literal}", |
---|
112 | recent_period_values[idx] |
---|
113 | ); |
---|
114 | } |
---|
115 | |
---|
116 | var nb_image_page_values = [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,35,40,45,50,60,70,80,90,100,200,300,500,999]; |
---|
117 | |
---|
118 | function getNbImagePageInfoFromIdx(idx) { |
---|
119 | return sprintf( |
---|
120 | "{/literal}{'%d photos per page'|@translate}{literal}", |
---|
121 | nb_image_page_values[idx] |
---|
122 | ); |
---|
123 | } |
---|
124 | |
---|
125 | /* Formating function for row details */ |
---|
126 | function fnFormatDetails(oTable, nTr) { |
---|
127 | var userId = oTable.fnGetData(nTr)[0]; |
---|
128 | console.log("userId = "+userId); |
---|
129 | var sOut = null; |
---|
130 | |
---|
131 | jQuery.ajax({ |
---|
132 | url: "ws.php?format=json&method=pwg.users.getList", |
---|
133 | type:"POST", |
---|
134 | data: { |
---|
135 | user_id: userId, |
---|
136 | display: "all", |
---|
137 | }, |
---|
138 | success:function(data) { |
---|
139 | jQuery("#user"+userId+" .loading").hide(); |
---|
140 | |
---|
141 | var data = jQuery.parseJSON(data); |
---|
142 | if (data.stat == 'ok') { |
---|
143 | var user = data.result.users[0]; |
---|
144 | |
---|
145 | var userDetails = '<form>'; |
---|
146 | userDetails += '<div class="userActions">'; |
---|
147 | userDetails += '<span class="changePasswordDone infos" style="display:none">✔ Password updated</span>'; |
---|
148 | userDetails += '<span class="changePassword" style="display:none">{/literal}{'New password'|translate}{literal} <input type="text"> <a href="#" class="buttonLike updatePassword"><img src="themes/default/images/ajax-loader-small.gif" style="margin-bottom:-1px;margin-left:1px;display:none;"><span class="text">{/literal}{'Submit'|translate}{literal}</span></a> <a href="#" class="cancel">Cancel</a></span>'; |
---|
149 | userDetails += '<a class="icon-key changePasswordOpen" href="#">Change password</a>'; |
---|
150 | userDetails += '<br><a target="_blank" href="admin.php?page=user_perm&user_id='+userId+'" class="icon-lock">Permissions</a>'; |
---|
151 | userDetails += '<br><span class="userDelete"><img class="loading" src="themes/default/images/ajax-loader-small.gif" style="display:none;"><a href="#" class="icon-trash" data-user_id="'+userId+'">Delete</a></span>'; |
---|
152 | userDetails += '</div>'; |
---|
153 | |
---|
154 | userDetails += '<span class="changeUsernameOpen"><strong class="username">'+user.username+'</strong> <a href="#" class="icon-pencil">Change username</a></span>'; |
---|
155 | userDetails += '<span class="changeUsername" style="display:none">'; |
---|
156 | userDetails += '<input type="text"> <a href="#" class="buttonLike updateUsername"><img src="themes/default/images/ajax-loader-small.gif" style="margin-bottom:-1px;margin-left:1px;display:none;"><span class="text">{/literal}{'Submit'|translate}{literal}</span></a> <a href="#" class="cancel">Cancel</a>'; |
---|
157 | userDetails += '</span>'; |
---|
158 | |
---|
159 | userDetails += '<div class="userStats">'; |
---|
160 | userDetails += sprintf(registeredOn_pattern, user.registration_date_string, user.registration_date_since); |
---|
161 | |
---|
162 | if (typeof user.last_visit != 'undefined') { |
---|
163 | userDetails += '<br>'+sprintf(lastVisit_pattern, user.last_visit_string, user.last_visit_since); |
---|
164 | } |
---|
165 | |
---|
166 | userDetails += '</div>'; |
---|
167 | userDetails += '<div class="userPropertiesContainer">'; |
---|
168 | userDetails += '<input type="hidden" name="user_id" value="'+user.id+'">'; |
---|
169 | userDetails += '<div class="userPropertiesSet">'; |
---|
170 | userDetails += '<div class="userPropertiesSetTitle">{/literal}{'Properties'|translate}{literal}</div>'; |
---|
171 | |
---|
172 | userDetails += '<div class="userProperty"><strong>{/literal}{'Email address'|translate}{literal}</strong>'; |
---|
173 | userDetails += '<br><input name="email" type="text" value="'+user.email+'"></div>'; |
---|
174 | |
---|
175 | userDetails += '<div class="userProperty"><strong>{/literal}{'Status'|translate}{literal}</strong>'; |
---|
176 | userDetails += '<br><select name="status">'; |
---|
177 | jQuery("#action select[name=status] option").each(function() { |
---|
178 | var selected = ''; |
---|
179 | if (user.status == jQuery(this).val()) { |
---|
180 | selected = ' selected="selected"'; |
---|
181 | } |
---|
182 | userDetails += '<option value="'+jQuery(this).val()+'"'+selected+'>'+jQuery(this).html()+'</option>'; |
---|
183 | }); |
---|
184 | userDetails += '</select></div>'; |
---|
185 | |
---|
186 | userDetails += '<div class="userProperty"><strong>{/literal}{'Privacy level'|translate}{literal}</strong>'; |
---|
187 | userDetails += '<br><select name="level">'; |
---|
188 | jQuery("#action select[name=level] option").each(function() { |
---|
189 | var selected = ''; |
---|
190 | if (user.level == jQuery(this).val()) { |
---|
191 | selected = ' selected="selected"'; |
---|
192 | } |
---|
193 | userDetails += '<option value="'+jQuery(this).val()+'"'+selected+'>'+jQuery(this).html()+'</option>'; |
---|
194 | }); |
---|
195 | userDetails += '</select></div>'; |
---|
196 | |
---|
197 | var checked = ''; |
---|
198 | if (user.enabled_high == 'true') { |
---|
199 | checked = ' checked="checked"'; |
---|
200 | } |
---|
201 | userDetails += '<div class="userProperty"><label><input type="checkbox" name="enabled_high"'+checked+'> <strong>{/literal}{'High definition enabled'|translate}{literal}</strong></label>'; |
---|
202 | userDetails += '</div>'; |
---|
203 | |
---|
204 | userDetails += '<div class="userProperty"><strong>{/literal}{'Groups'|translate}{literal}</strong>'; |
---|
205 | userDetails += '<br><select multiple class="chzn-select" style="width:340px;" name="group_id[]">'; |
---|
206 | jQuery("#action select[name=associate] option").each(function() { |
---|
207 | var selected = ''; |
---|
208 | if (user.groups.indexOf(jQuery(this).val()) != -1) { |
---|
209 | selected = ' selected="selected"'; |
---|
210 | } |
---|
211 | userDetails += '<option value="'+jQuery(this).val()+'"'+selected+'>'+jQuery(this).html()+'</option>'; |
---|
212 | }); |
---|
213 | userDetails += '</select></div>'; |
---|
214 | // userDetails += '<br>'+user.groups.join(",")+'</div>'; |
---|
215 | |
---|
216 | userDetails += '</div><div class="userPropertiesSet userPrefs">'; |
---|
217 | userDetails += '<div class="userPropertiesSetTitle">{/literal}{'Preferences'|translate}{literal}</div>'; |
---|
218 | |
---|
219 | userDetails += '<div class="userProperty"><strong class="nb_image_page_infos"></strong>'; |
---|
220 | userDetails += '<div class="nb_image_page"></div>'; |
---|
221 | userDetails += '<input type="hidden" name="nb_image_page" value="'+user.nb_image_page+'">'; |
---|
222 | userDetails += '</div>'; |
---|
223 | |
---|
224 | userDetails += '<div class="userProperty"><strong>{/literal}{'Theme'|translate}{literal}</strong>'; |
---|
225 | userDetails += '<br><select name="theme">'; |
---|
226 | jQuery("#action select[name=theme] option").each(function() { |
---|
227 | var selected = ''; |
---|
228 | if (user.theme == jQuery(this).val()) { |
---|
229 | selected = ' selected="selected"'; |
---|
230 | } |
---|
231 | userDetails += '<option value="'+jQuery(this).val()+'"'+selected+'>'+jQuery(this).html()+'</option>'; |
---|
232 | }); |
---|
233 | userDetails += '</select></div>'; |
---|
234 | |
---|
235 | userDetails += '<div class="userProperty"><strong>{/literal}{'Language'|translate}{literal}</strong>'; |
---|
236 | userDetails += '<br><select name="language">'; |
---|
237 | jQuery("#action select[name=language] option").each(function() { |
---|
238 | var selected = ''; |
---|
239 | if (user.language == jQuery(this).val()) { |
---|
240 | selected = ' selected="selected"'; |
---|
241 | } |
---|
242 | userDetails += '<option value="'+jQuery(this).val()+'"'+selected+'>'+jQuery(this).html()+'</option>'; |
---|
243 | }); |
---|
244 | userDetails += '</select></div>'; |
---|
245 | |
---|
246 | userDetails += '<div class="userProperty"><strong>{/literal}{'Recent period'|translate}{literal}</strong> <span class="recent_period_infos"></span>'; |
---|
247 | userDetails += '<div class="recent_period"></div>'; |
---|
248 | userDetails += '<input type="hidden" name="recent_period" value="'+user.recent_period+'">'; |
---|
249 | userDetails += '</div>'; |
---|
250 | |
---|
251 | var checked = ''; |
---|
252 | if (user.expand == 'true') { |
---|
253 | checked = ' checked="checked"'; |
---|
254 | } |
---|
255 | userDetails += '<div class="userProperty"><label><input type="checkbox" name="expand"'+checked+'> <strong>{/literal}{'Expand all albums'|translate}{literal}</strong></label>'; |
---|
256 | userDetails += '</div>'; |
---|
257 | |
---|
258 | var checked = ''; |
---|
259 | if (user.show_nb_comments == 'true') { |
---|
260 | checked = ' checked="checked"'; |
---|
261 | } |
---|
262 | userDetails += '<div class="userProperty"><label><input type="checkbox" name="show_nb_comments"'+checked+'> <strong>{/literal}{'Show number of comments'|translate}{literal}</strong></label>'; |
---|
263 | userDetails += '</div>'; |
---|
264 | |
---|
265 | var checked = ''; |
---|
266 | if (user.show_nb_hits == 'true') { |
---|
267 | checked = ' checked="checked"'; |
---|
268 | } |
---|
269 | userDetails += '<div class="userProperty"><label><input type="checkbox" name="show_nb_hits"'+checked+'> <strong>{/literal}{'Show number of hits'|translate}{literal}</strong></label>'; |
---|
270 | userDetails += '</div>'; |
---|
271 | userDetails += '</div>'; |
---|
272 | userDetails += '<div style="clear:both"></div></div>'; |
---|
273 | |
---|
274 | userDetails += '<span class="infos propertiesUpdateDone" style="display:none">✔ User '+user.username+' updated</span>'; |
---|
275 | userDetails += '<input type="submit" value="{/literal}{'Update user'|translate}{literal}" style="display:none;" data-user_id="'+userId+'">'; |
---|
276 | userDetails += '<img class="submitWait" src="themes/default/images/ajax-loader-small.gif" style="display:none">' |
---|
277 | userDetails += '</form>'; |
---|
278 | |
---|
279 | jQuery("#user"+userId).append(userDetails); |
---|
280 | jQuery(".chzn-select").chosen(); |
---|
281 | |
---|
282 | /* nb_image_page slider */ |
---|
283 | var nb_image_page_init = getSliderKeyFromValue(jQuery('input[name=nb_image_page]').val(), nb_image_page_values); |
---|
284 | |
---|
285 | jQuery('#user'+userId+' .nb_image_page_infos').html(getNbImagePageInfoFromIdx(nb_image_page_init)); |
---|
286 | |
---|
287 | jQuery('#user'+userId+' .nb_image_page').slider({ |
---|
288 | range: "min", |
---|
289 | min: 0, |
---|
290 | max: nb_image_page_values.length - 1, |
---|
291 | value: nb_image_page_init, |
---|
292 | slide: function( event, ui ) { |
---|
293 | jQuery('#user'+userId+' .nb_image_page_infos').html(getNbImagePageInfoFromIdx(ui.value)); |
---|
294 | }, |
---|
295 | stop: function( event, ui ) { |
---|
296 | jQuery('#user'+userId+' input[name=nb_image_page]').val(nb_image_page_values[ui.value]).trigger('change'); |
---|
297 | } |
---|
298 | }); |
---|
299 | |
---|
300 | /* recent_period slider */ |
---|
301 | var recent_period_init = getSliderKeyFromValue(jQuery('input[name=recent_period]').val(), recent_period_values); |
---|
302 | jQuery('#user'+userId+' .recent_period_infos').html(getRecentPeriodInfoFromIdx(recent_period_init)); |
---|
303 | |
---|
304 | jQuery('#user'+userId+' .recent_period').slider({ |
---|
305 | range: "min", |
---|
306 | min: 0, |
---|
307 | max: recent_period_values.length - 1, |
---|
308 | value: recent_period_init, |
---|
309 | slide: function( event, ui ) { |
---|
310 | jQuery('#user'+userId+' .recent_period_infos').html(getRecentPeriodInfoFromIdx(ui.value)); |
---|
311 | }, |
---|
312 | stop: function( event, ui ) { |
---|
313 | jQuery('#user'+userId+' input[name=recent_period]').val(recent_period_values[ui.value]).trigger('change'); |
---|
314 | } |
---|
315 | }); |
---|
316 | } |
---|
317 | else { |
---|
318 | console.log('error loading user details'); |
---|
319 | } |
---|
320 | }, |
---|
321 | error:function(XMLHttpRequest, textStatus, errorThrows) { |
---|
322 | console.log('technical error loading user details'); |
---|
323 | } |
---|
324 | }); |
---|
325 | |
---|
326 | return '<div id="user'+userId+'" class="userProperties"><img class="loading" src="themes/default/images/ajax-loader-small.gif"></div>'; |
---|
327 | } |
---|
328 | |
---|
329 | /* change password */ |
---|
330 | jQuery(document).on('click', '.changePasswordOpen', function() { |
---|
331 | var userId = jQuery(this).parentsUntil('form').parent().find('input[name=user_id]').val(); |
---|
332 | |
---|
333 | jQuery(this).hide(); |
---|
334 | jQuery('#user'+userId+' .changePasswordDone').hide(); |
---|
335 | jQuery('#user'+userId+' .changePassword').show(); |
---|
336 | jQuery('#user'+userId+' .changePassword input[type=text]').focus(); |
---|
337 | |
---|
338 | return false; |
---|
339 | }); |
---|
340 | |
---|
341 | jQuery(document).on('click', '.changePassword a.updatePassword', function() { |
---|
342 | var userId = jQuery(this).parentsUntil('form').parent().find('input[name=user_id]').val(); |
---|
343 | |
---|
344 | jQuery('#user'+userId+' .changePassword a .text').hide(); |
---|
345 | jQuery('#user'+userId+' .changePassword a img').show(); |
---|
346 | |
---|
347 | jQuery.ajax({ |
---|
348 | url: "ws.php?format=json&method=pwg.users.setInfo", |
---|
349 | type:"POST", |
---|
350 | data: { |
---|
351 | user_id:userId, |
---|
352 | password: jQuery('#user'+userId+' .changePassword input[type=text]').val() |
---|
353 | }, |
---|
354 | beforeSend: function() { |
---|
355 | jQuery('#user'+userId+' .changePassword input[type=text]').val(""); |
---|
356 | }, |
---|
357 | success:function(data) { |
---|
358 | jQuery('#user'+userId+' .changePassword a .text').show(); |
---|
359 | jQuery('#user'+userId+' .changePassword a img').hide(); |
---|
360 | jQuery('#user'+userId+' .changePassword').hide(); |
---|
361 | jQuery('#user'+userId+' .changePasswordOpen').show(); |
---|
362 | jQuery('#user'+userId+' .changePasswordDone').show(); |
---|
363 | }, |
---|
364 | error:function(XMLHttpRequest, textStatus, errorThrows) { |
---|
365 | } |
---|
366 | }); |
---|
367 | |
---|
368 | return false; |
---|
369 | }); |
---|
370 | |
---|
371 | jQuery(document).on('click', '.changePassword a.cancel', function() { |
---|
372 | var userId = jQuery(this).parentsUntil('form').parent().find('input[name=user_id]').val(); |
---|
373 | |
---|
374 | jQuery('#user'+userId+' .changePassword').hide(); |
---|
375 | jQuery('#user'+userId+' .changePasswordOpen').show(); |
---|
376 | |
---|
377 | return false; |
---|
378 | }); |
---|
379 | |
---|
380 | /* change username */ |
---|
381 | jQuery(document).on('click', '.changeUsernameOpen a', function() { |
---|
382 | var userId = jQuery(this).parentsUntil('form').parent().find('input[name=user_id]').val(); |
---|
383 | var username = jQuery('#user'+userId+' .username').html(); |
---|
384 | |
---|
385 | jQuery('#user'+userId+' .changeUsernameOpen').hide(); |
---|
386 | jQuery('#user'+userId+' .changeUsername').show(); |
---|
387 | jQuery('#user'+userId+' .changeUsername input[type=text]').val(username).focus(); |
---|
388 | |
---|
389 | return false; |
---|
390 | }); |
---|
391 | |
---|
392 | jQuery(document).on('click', 'a.updateUsername', function() { |
---|
393 | var userId = jQuery(this).parentsUntil('form').parent().find('input[name=user_id]').val(); |
---|
394 | |
---|
395 | jQuery('#user'+userId+' .changeUsername a .text').hide(); |
---|
396 | jQuery('#user'+userId+' .changeUsername a img').show(); |
---|
397 | |
---|
398 | jQuery.ajax({ |
---|
399 | url: "ws.php?format=json&method=pwg.users.setInfo", |
---|
400 | type:"POST", |
---|
401 | data: { |
---|
402 | user_id:userId, |
---|
403 | username: jQuery('#user'+userId+' .changeUsername input[type=text]').val() |
---|
404 | }, |
---|
405 | success:function(data) { |
---|
406 | jQuery('#user'+userId+' .changeUsername a .text').show(); |
---|
407 | jQuery('#user'+userId+' .changeUsername a img').hide(); |
---|
408 | jQuery('#user'+userId+' .changeUsername').hide(); |
---|
409 | jQuery('#user'+userId+' .changeUsernameOpen').show(); |
---|
410 | |
---|
411 | var data = jQuery.parseJSON(data); |
---|
412 | jQuery('#user'+userId+' .username').html(data.result.users[0].username); |
---|
413 | }, |
---|
414 | error:function(XMLHttpRequest, textStatus, errorThrows) { |
---|
415 | } |
---|
416 | }); |
---|
417 | |
---|
418 | return false; |
---|
419 | }); |
---|
420 | |
---|
421 | jQuery(document).on('click', '.changeUsername a.cancel', function() { |
---|
422 | var userId = jQuery(this).parentsUntil('form').parent().find('input[name=user_id]').val(); |
---|
423 | |
---|
424 | jQuery('#user'+userId+' .changeUsername').hide(); |
---|
425 | jQuery('#user'+userId+' .changeUsernameOpen').show(); |
---|
426 | |
---|
427 | return false; |
---|
428 | }); |
---|
429 | |
---|
430 | /* display the "save" button when a field changes */ |
---|
431 | jQuery(document).on('change', '.userProperties input, .userProperties select', function() { |
---|
432 | var userId = jQuery(this).parentsUntil('form').parent().find('input[name=user_id]').val(); |
---|
433 | |
---|
434 | jQuery('#user'+userId+' input[type=submit]').show(); |
---|
435 | jQuery('#user'+userId+' .propertiesUpdateDone').hide(); |
---|
436 | }); |
---|
437 | |
---|
438 | /* delete user */ |
---|
439 | jQuery(document).on('click', '.userDelete a', function() { |
---|
440 | if (!confirm("{/literal}{'Are you sure?'|translate|escape:javascript}{literal}")) { |
---|
441 | return false; |
---|
442 | } |
---|
443 | |
---|
444 | var userId = jQuery(this).data('user_id'); |
---|
445 | var username = jQuery('#user'+userId+' .username').html(); |
---|
446 | |
---|
447 | jQuery.ajax({ |
---|
448 | url: "ws.php?format=json&method=pwg.users.delete", |
---|
449 | type:"POST", |
---|
450 | data: { |
---|
451 | user_id:userId, |
---|
452 | pwg_token:pwg_token |
---|
453 | }, |
---|
454 | beforeSend: function() { |
---|
455 | jQuery('#user'+userId+' .userDelete .loading').show(); |
---|
456 | }, |
---|
457 | success:function(data) { |
---|
458 | oTable.fnDraw(); |
---|
459 | jQuery('#showAddUser .infos').html('✔ User '+username+' deleted').show(); |
---|
460 | }, |
---|
461 | error:function(XMLHttpRequest, textStatus, errorThrows) { |
---|
462 | jQuery('#user'+userId+' .userDelete .loading').hide(); |
---|
463 | } |
---|
464 | }); |
---|
465 | |
---|
466 | return false; |
---|
467 | }); |
---|
468 | |
---|
469 | jQuery(document).on('click', '.userProperties input[type=submit]', function() { |
---|
470 | var userId = jQuery(this).data('user_id'); |
---|
471 | |
---|
472 | var formData = jQuery('#user'+userId+' form').serialize(); |
---|
473 | |
---|
474 | if (jQuery('#user'+userId+' form select[name="group_id[]"] option:selected').length == 0) { |
---|
475 | formData += '&group_id=-1'; |
---|
476 | } |
---|
477 | |
---|
478 | if (!jQuery('#user'+userId+' form input[name=enabled_high]').is(':checked')) { |
---|
479 | formData += '&enabled_high=false'; |
---|
480 | } |
---|
481 | |
---|
482 | if (!jQuery('#user'+userId+' form input[name=expand]').is(':checked')) { |
---|
483 | formData += '&expand=false'; |
---|
484 | } |
---|
485 | |
---|
486 | if (!jQuery('#user'+userId+' form input[name=show_nb_hits]').is(':checked')) { |
---|
487 | formData += '&show_nb_hits=false'; |
---|
488 | } |
---|
489 | |
---|
490 | if (!jQuery('#user'+userId+' form input[name=show_nb_comments]').is(':checked')) { |
---|
491 | formData += '&show_nb_comments=false'; |
---|
492 | } |
---|
493 | |
---|
494 | jQuery.ajax({ |
---|
495 | url: "ws.php?format=json&method=pwg.users.setInfo", |
---|
496 | type:"POST", |
---|
497 | data: formData, |
---|
498 | beforeSend: function() { |
---|
499 | jQuery('#user'+userId+' .submitWait').show(); |
---|
500 | }, |
---|
501 | success:function(data) { |
---|
502 | jQuery('#user'+userId+' .submitWait').hide(); |
---|
503 | jQuery('#user'+userId+' input[type=submit]').hide(); |
---|
504 | jQuery('#user'+userId+' .propertiesUpdateDone').show(); |
---|
505 | }, |
---|
506 | error:function(XMLHttpRequest, textStatus, errorThrows) { |
---|
507 | jQuery('#user'+userId+' .submitWait').hide(); |
---|
508 | } |
---|
509 | }); |
---|
510 | |
---|
511 | return false; |
---|
512 | }); |
---|
513 | |
---|
514 | /* Add event listener for opening and closing details |
---|
515 | * Note that the indicator for showing which row is open is not controlled by DataTables, |
---|
516 | * rather it is done here |
---|
517 | */ |
---|
518 | jQuery(document).on('click', '#userList tbody td .openUserDetails', function() { |
---|
519 | var nTr = this.parentNode.parentNode; |
---|
520 | if (jQuery(this).hasClass('icon-angle-circled-up')) { |
---|
521 | /* This row is already open - close it */ |
---|
522 | jQuery(this).removeClass('icon-angle-circled-up').addClass('icon-angle-circled-down').attr('title', 'Open user details'); |
---|
523 | oTable.fnClose( nTr ); |
---|
524 | } |
---|
525 | else { |
---|
526 | /* Open this row */ |
---|
527 | jQuery(this).removeClass('icon-angle-circled-down').addClass('icon-angle-circled-up').attr('title', 'Close user details'); |
---|
528 | oTable.fnOpen( nTr, fnFormatDetails(oTable, nTr), 'details' ); |
---|
529 | } |
---|
530 | }); |
---|
531 | |
---|
532 | |
---|
533 | /* first column must be prefixed with the open/close icon */ |
---|
534 | var aoColumns = [ |
---|
535 | { |
---|
536 | 'bVisible':false |
---|
537 | }, |
---|
538 | { |
---|
539 | "mRender": function(data, type, full) { |
---|
540 | return '<span title="Open user details" class="icon-angle-circled-down openUserDetails"></span> <label><input type="checkbox" data-user_id="'+full[0]+'"> '+data+'</label>'; |
---|
541 | } |
---|
542 | } |
---|
543 | ]; |
---|
544 | |
---|
545 | for (i=2; i<jQuery("#userList thead tr th").length; i++) { |
---|
546 | aoColumns.push(null); |
---|
547 | } |
---|
548 | |
---|
549 | var oTable = jQuery('#userList').dataTable({ |
---|
550 | "iDisplayLength": 10, |
---|
551 | "bDeferRender": true, |
---|
552 | "bProcessing": true, |
---|
553 | "bServerSide": true, |
---|
554 | "sAjaxSource": "admin/user_list_backend.php", |
---|
555 | "oLanguage": { |
---|
556 | "sProcessing": "Traitement en cours...", |
---|
557 | "sLengthMenu": "Afficher _MENU_ éléments", |
---|
558 | "sZeroRecords": "Aucun élément à afficher", |
---|
559 | "sInfo": "Affichage des élements _START_ à _END_ sur _TOTAL_", |
---|
560 | "sInfoEmpty": "Affichage de l'élement 0 à 0 sur 0 éléments", |
---|
561 | "sInfoFiltered": "<br>(filtré de _MAX_ éléments au total{/literal}{if $is_a_guest} <span class='limitedVersionWarning'>dans la version complète</span>{/if}{literal})", |
---|
562 | "sInfoPostFix": "", |
---|
563 | "sSearch": "Rechercher", |
---|
564 | "sLoadingRecords": "Téléchargement...", |
---|
565 | "sUrl": "", |
---|
566 | "oPaginate": { |
---|
567 | "sFirst": "Premier", |
---|
568 | "sPrevious": "← Précédent", |
---|
569 | "sNext": "Suivant →", |
---|
570 | "sLast": "Dernier" |
---|
571 | } |
---|
572 | }, |
---|
573 | "fnDrawCallback": function( oSettings ) { |
---|
574 | jQuery("#userList input[type=checkbox]").each(function() { |
---|
575 | var user_id = jQuery(this).data("user_id"); |
---|
576 | jQuery(this).prop('checked', (selection.indexOf(user_id) != -1)); |
---|
577 | }); |
---|
578 | }, |
---|
579 | "aoColumns": aoColumns |
---|
580 | }); |
---|
581 | |
---|
582 | /** |
---|
583 | * Selection management |
---|
584 | */ |
---|
585 | function checkSelection() { |
---|
586 | if (selection.length > 0) { |
---|
587 | jQuery("#forbidAction").hide(); |
---|
588 | jQuery("#permitAction").show(); |
---|
589 | |
---|
590 | jQuery("#applyOnDetails").text( |
---|
591 | sprintf( |
---|
592 | applyOnDetails_pattern, |
---|
593 | selection.length |
---|
594 | ) |
---|
595 | ); |
---|
596 | |
---|
597 | if (selection.length == allUsers.length) { |
---|
598 | jQuery("#selectedMessage").text( |
---|
599 | sprintf( |
---|
600 | selectedMessage_all, |
---|
601 | allUsers.length |
---|
602 | ) |
---|
603 | ); |
---|
604 | } |
---|
605 | else { |
---|
606 | jQuery("#selectedMessage").text( |
---|
607 | sprintf( |
---|
608 | selectedMessage_pattern, |
---|
609 | selection.length, |
---|
610 | allUsers.length |
---|
611 | ) |
---|
612 | ); |
---|
613 | } |
---|
614 | } |
---|
615 | else { |
---|
616 | jQuery("#forbidAction").show(); |
---|
617 | jQuery("#permitAction").hide(); |
---|
618 | |
---|
619 | jQuery("#selectedMessage").text( |
---|
620 | sprintf( |
---|
621 | selectedMessage_none, |
---|
622 | allUsers.length |
---|
623 | ) |
---|
624 | ); |
---|
625 | } |
---|
626 | |
---|
627 | jQuery("#applyActionBlock .infos").hide(); |
---|
628 | } |
---|
629 | |
---|
630 | jQuery(document).on('change', '#userList input[type=checkbox]', function() { |
---|
631 | var user_id = jQuery(this).data("user_id"); |
---|
632 | |
---|
633 | array_delete(selection, user_id); |
---|
634 | |
---|
635 | if (jQuery(this).is(":checked")) { |
---|
636 | selection.push(user_id); |
---|
637 | } |
---|
638 | |
---|
639 | checkSelection(); |
---|
640 | }); |
---|
641 | |
---|
642 | jQuery("#selectAll").click(function () { |
---|
643 | selection = allUsers; |
---|
644 | jQuery("#userList input[type=checkbox]").prop('checked', true); |
---|
645 | checkSelection(); |
---|
646 | return false; |
---|
647 | }); |
---|
648 | |
---|
649 | jQuery("#selectNone").click(function () { |
---|
650 | selection = []; |
---|
651 | jQuery("#userList input[type=checkbox]").prop('checked', false); |
---|
652 | checkSelection(); |
---|
653 | return false; |
---|
654 | }); |
---|
655 | |
---|
656 | jQuery("#selectInvert").click(function () { |
---|
657 | var newSelection = []; |
---|
658 | for(var i in allUsers) |
---|
659 | { |
---|
660 | if (selection.indexOf(allUsers[i]) == -1) { |
---|
661 | newSelection.push(allUsers[i]); |
---|
662 | } |
---|
663 | } |
---|
664 | selection = newSelection; |
---|
665 | |
---|
666 | jQuery("#userList input[type=checkbox]").each(function() { |
---|
667 | var user_id = jQuery(this).data("user_id"); |
---|
668 | jQuery(this).prop('checked', (selection.indexOf(user_id) != -1)); |
---|
669 | }); |
---|
670 | |
---|
671 | checkSelection(); |
---|
672 | return false; |
---|
673 | }); |
---|
674 | |
---|
675 | /** |
---|
676 | * Action management |
---|
677 | */ |
---|
678 | jQuery("[id^=action_]").hide(); |
---|
679 | |
---|
680 | jQuery("select[name=selectAction]").change(function () { |
---|
681 | jQuery("#applyActionBlock .infos").hide(); |
---|
682 | |
---|
683 | jQuery("[id^=action_]").hide(); |
---|
684 | |
---|
685 | jQuery("#action_"+$(this).prop("value")).show(); |
---|
686 | |
---|
687 | if (jQuery(this).val() != -1) { |
---|
688 | jQuery("#applyActionBlock").show(); |
---|
689 | } |
---|
690 | else { |
---|
691 | jQuery("#applyActionBlock").hide(); |
---|
692 | } |
---|
693 | }); |
---|
694 | |
---|
695 | jQuery("#permitAction input, #permitAction select").click(function() { |
---|
696 | jQuery("#applyActionBlock .infos").hide(); |
---|
697 | }); |
---|
698 | |
---|
699 | jQuery("#applyAction").click(function() { |
---|
700 | var action = jQuery("select[name=selectAction]").prop("value"); |
---|
701 | var method = 'pwg.users.setInfo'; |
---|
702 | var data = { |
---|
703 | user_id: selection |
---|
704 | }; |
---|
705 | |
---|
706 | switch (action) { |
---|
707 | case 'delete': |
---|
708 | if (!jQuery("input[name=confirm_deletion]").is(':checked')) { |
---|
709 | alert(missingConfirm); |
---|
710 | return false; |
---|
711 | } |
---|
712 | method = 'pwg.users.delete'; |
---|
713 | data.pwg_token = pwg_token; |
---|
714 | break; |
---|
715 | case 'group_associate': |
---|
716 | method = 'pwg.groups.addUser'; |
---|
717 | data.group_id = jQuery("select[name=associate]").prop("value"); |
---|
718 | break; |
---|
719 | case 'group_dissociate': |
---|
720 | method = 'pwg.groups.deleteUser'; |
---|
721 | data.group_id = jQuery("select[name=dissociate]").prop("value"); |
---|
722 | break; |
---|
723 | case 'status': |
---|
724 | data.status = jQuery("select[name=status]").prop("value"); |
---|
725 | break; |
---|
726 | case 'enabled_high': |
---|
727 | data.enabled_high = jQuery("input[name=enabled_high]:checked").val(); |
---|
728 | break; |
---|
729 | case 'level': |
---|
730 | data.level = jQuery("select[name=level]").val(); |
---|
731 | break; |
---|
732 | case 'nb_image_page': |
---|
733 | data.nb_image_page = jQuery("input[name=nb_image_page]").val(); |
---|
734 | break; |
---|
735 | case 'theme': |
---|
736 | data.theme = jQuery("select[name=theme]").val(); |
---|
737 | break; |
---|
738 | case 'language': |
---|
739 | data.language = jQuery("select[name=language]").val(); |
---|
740 | break; |
---|
741 | case 'recent_period': |
---|
742 | data.recent_period = jQuery("input[name=recent_period]").val(); |
---|
743 | break; |
---|
744 | case 'expand': |
---|
745 | data.expand = jQuery("input[name=expand]:checked").val(); |
---|
746 | break; |
---|
747 | case 'show_nb_comments': |
---|
748 | data.show_nb_comments = jQuery("input[name=show_nb_comments]:checked").val(); |
---|
749 | break; |
---|
750 | case 'show_nb_hits': |
---|
751 | data.show_nb_hits = jQuery("input[name=show_nb_hits]:checked").val(); |
---|
752 | break; |
---|
753 | default: |
---|
754 | alert("Unexpected action"); |
---|
755 | return false; |
---|
756 | } |
---|
757 | |
---|
758 | jQuery.ajax({ |
---|
759 | url: "ws.php?format=json&method="+method, |
---|
760 | type:"POST", |
---|
761 | data: data, |
---|
762 | beforeSend: function() { |
---|
763 | jQuery("#applyActionLoading").show(); |
---|
764 | }, |
---|
765 | success:function(data) { |
---|
766 | oTable.fnDraw(); |
---|
767 | jQuery("#applyActionLoading").hide(); |
---|
768 | jQuery("#applyActionBlock .infos").show(); |
---|
769 | |
---|
770 | if (action == 'delete') { |
---|
771 | var allUsers_new = []; |
---|
772 | for(var i in allUsers) |
---|
773 | { |
---|
774 | if (selection.indexOf(allUsers[i]) == -1) { |
---|
775 | allUsers_new.push(allUsers[i]); |
---|
776 | } |
---|
777 | } |
---|
778 | allUsers = allUsers_new; |
---|
779 | console.log('allUsers_new.length = '+allUsers_new.length); |
---|
780 | selection = []; |
---|
781 | checkSelection(); |
---|
782 | } |
---|
783 | }, |
---|
784 | error:function(XMLHttpRequest, textStatus, errorThrows) { |
---|
785 | jQuery("#applyActionLoading").hide(); |
---|
786 | } |
---|
787 | }); |
---|
788 | |
---|
789 | return false; |
---|
790 | }); |
---|
791 | |
---|
792 | }); |
---|
793 | {/literal}{/footer_script} |
---|
794 | |
---|
795 | {literal} |
---|
796 | <style> |
---|
797 | .dataTables_wrapper, .dataTables_info {clear:none;} |
---|
798 | table.dataTable {clear:right;padding-top:10px;} |
---|
799 | .dataTable td img {margin-bottom: -6px;margin-left: -6px;} |
---|
800 | .paginate_enabled_previous, .paginate_enabled_previous:hover, .paginate_disabled_previous, .paginate_enabled_next, .paginate_enabled_next:hover, .paginate_disabled_next {background:none;} |
---|
801 | .paginate_enabled_previous, .paginate_enabled_next {color:#005E89 !important;} |
---|
802 | .paginate_enabled_previous:hover, .paginate_enabled_next:hover {color:#D54E21 !important; text-decoration:underline !important;} |
---|
803 | |
---|
804 | .paginate_disabled_next, .paginate_enabled_next {padding-right:3px;} |
---|
805 | .bulkAction {margin-top:10px;} |
---|
806 | #addUserForm p {margin-left:0;} |
---|
807 | #applyActionBlock .actionButtons {margin-left:0;} |
---|
808 | span.infos, span.errors {background-image:none; padding:2px 5px; margin:0;border-radius:5px;} |
---|
809 | |
---|
810 | .userStats {margin-top:10px;} |
---|
811 | .recent_period_infos {margin-left:10px;} |
---|
812 | .nb_image_page, .recent_period {width:340px;margin-top:5px;} |
---|
813 | </style> |
---|
814 | {/literal} |
---|
815 | |
---|
816 | <div class="titrePage"> |
---|
817 | <h2>{'User list'|@translate}</h2> |
---|
818 | </div> |
---|
819 | |
---|
820 | <p class="showCreateAlbum" id="showAddUser"> |
---|
821 | <a href="#" id="addUser" class="icon-plus-circled">{'Add a user'|translate}</a> |
---|
822 | <span class="infos" style="display:none"></span> |
---|
823 | </p> |
---|
824 | |
---|
825 | <form id="addUserForm" style="display:none" method="post" name="add_user" action="{$F_ADD_ACTION}"> |
---|
826 | <fieldset> |
---|
827 | <legend>{'Add a user'|@translate}</legend> |
---|
828 | |
---|
829 | <p> |
---|
830 | <strong>{'Username'|translate}</strong><br> |
---|
831 | <input type="text" name="username" maxlength="50" size="20"> |
---|
832 | </p> |
---|
833 | |
---|
834 | <p> |
---|
835 | <strong>{'Password'|translate}</strong><br> |
---|
836 | <input type="{if $Double_Password}password{else}text{/if}" name="password"> |
---|
837 | </p> |
---|
838 | |
---|
839 | {if $Double_Password} |
---|
840 | <p> |
---|
841 | <strong>{'Confirm Password'|@translate}</strong><br> |
---|
842 | <input type="password" name="password_confirm"> |
---|
843 | </p> |
---|
844 | {/if} |
---|
845 | |
---|
846 | <p> |
---|
847 | <strong>{'Email address'|@translate}</strong><br> |
---|
848 | <input type="text" name="email"> |
---|
849 | </p> |
---|
850 | |
---|
851 | <p> |
---|
852 | <label><input type="checkbox" name="send_password_by_mail"> <strong>{'Send connection settings by email'|@translate}</strong></label> |
---|
853 | </p> |
---|
854 | |
---|
855 | <p class="actionButtons"> |
---|
856 | <input class="submit" name="submit_add" type="submit" value="{'Submit'|@translate}"> |
---|
857 | <a href="#" id="addUserClose">{'Cancel'|@translate}</a> |
---|
858 | <span class="loading" style="display:none"><img src="themes/default/images/ajax-loader-small.gif"></span> |
---|
859 | <span class="errors" style="display:none"></span> |
---|
860 | </p> |
---|
861 | </fieldset> |
---|
862 | </form> |
---|
863 | |
---|
864 | <form method="post" name="preferences" action=""> |
---|
865 | |
---|
866 | <table id="userList"> |
---|
867 | <thead> |
---|
868 | <tr> |
---|
869 | <th>id</th> |
---|
870 | <th>{'Username'|@translate}</th> |
---|
871 | <th>{'Status'|@translate}</th> |
---|
872 | <th>{'Email address'|@translate}</th> |
---|
873 | <th>{'registration date'|@translate}</th> |
---|
874 | </tr> |
---|
875 | </thead> |
---|
876 | </table> |
---|
877 | |
---|
878 | <div style="clear:right"></div> |
---|
879 | |
---|
880 | <p class="checkActions"> |
---|
881 | {'Select:'|@translate} |
---|
882 | <a href="#" id="selectAll">{'All'|@translate}</a>, |
---|
883 | <a href="#" id="selectNone">{'None'|@translate}</a>, |
---|
884 | <a href="#" id="selectInvert">{'Invert'|@translate}</a> |
---|
885 | |
---|
886 | <span id="selectedMessage"></span> |
---|
887 | </p> |
---|
888 | |
---|
889 | <fieldset id="action"> |
---|
890 | <legend>{'Action'|@translate}</legend> |
---|
891 | |
---|
892 | <div id="forbidAction"{if count($selection) != 0} style="display:none"{/if}>{'No user selected, no action possible.'|@translate}</div> |
---|
893 | <div id="permitAction"{if count($selection) == 0} style="display:none"{/if}> |
---|
894 | |
---|
895 | <select name="selectAction"> |
---|
896 | <option value="-1">{'Choose an action'|@translate}</option> |
---|
897 | <option disabled="disabled">------------------</option> |
---|
898 | <option value="delete" class="icon-trash">{'Delete selected users'|@translate}</option> |
---|
899 | <option value="status">{'Status'|@translate}</option> |
---|
900 | <option value="group_associate">{'associate to group'|translate}</option> |
---|
901 | <option value="group_dissociate">{'dissociate from group'|@translate}</option> |
---|
902 | <option value="enabled_high">{'High definition enabled'|@translate}</option> |
---|
903 | <option value="level">{'Privacy level'|@translate}</option> |
---|
904 | <option value="nb_image_page">{'Number of photos per page'|@translate}</option> |
---|
905 | <option value="theme">{'Interface theme'|@translate}</option> |
---|
906 | <option value="language">{'Language'|@translate}</option> |
---|
907 | <option value="recent_period">{'Recent period'|@translate}</option> |
---|
908 | <option value="expand">{'Expand all albums'|@translate}</option> |
---|
909 | {if $ACTIVATE_COMMENTS} |
---|
910 | <option value="show_nb_comments">{'Show number of comments'|@translate}</option> |
---|
911 | {/if} |
---|
912 | <option value="show_nb_hits">{'Show number of hits'|@translate}</option> |
---|
913 | </select> |
---|
914 | |
---|
915 | {* delete *} |
---|
916 | <div id="action_delete" class="bulkAction"> |
---|
917 | <p><label><input type="checkbox" name="confirm_deletion" value="1"> {'Are you sure?'|@translate}</label></p> |
---|
918 | </div> |
---|
919 | |
---|
920 | {* status *} |
---|
921 | <div id="action_status" class="bulkAction"> |
---|
922 | <select name="status"> |
---|
923 | {html_options options=$pref_status_options selected=$pref_status_selected} |
---|
924 | </select> |
---|
925 | </div> |
---|
926 | |
---|
927 | {* group_associate *} |
---|
928 | <div id="action_group_associate" class="bulkAction"> |
---|
929 | {html_options name=associate options=$association_options selected=$associate_selected} |
---|
930 | </div> |
---|
931 | |
---|
932 | {* group_dissociate *} |
---|
933 | <div id="action_group_dissociate" class="bulkAction"> |
---|
934 | {html_options name=dissociate options=$association_options selected=$dissociate_selected} |
---|
935 | </div> |
---|
936 | |
---|
937 | {* enabled_high *} |
---|
938 | <div id="action_enabled_high" class="bulkAction"> |
---|
939 | <label><input type="radio" name="enabled_high" value="true">{'Yes'|@translate}</label> |
---|
940 | <label><input type="radio" name="enabled_high" value="false" checked="checked">{'No'|@translate}</label> |
---|
941 | </div> |
---|
942 | |
---|
943 | {* level *} |
---|
944 | <div id="action_level" class="bulkAction"> |
---|
945 | <select name="level" size="1"> |
---|
946 | {html_options options=$level_options selected=$level_selected} |
---|
947 | </select> |
---|
948 | </div> |
---|
949 | |
---|
950 | {* nb_image_page *} |
---|
951 | <div id="action_nb_image_page" class="bulkAction"> |
---|
952 | <input size="4" maxlength="3" type="text" name="nb_image_page" value="{$NB_IMAGE_PAGE}"> |
---|
953 | </div> |
---|
954 | |
---|
955 | {* theme *} |
---|
956 | <div id="action_theme" class="bulkAction"> |
---|
957 | <select name="theme" size="1"> |
---|
958 | {html_options options=$theme_options selected=$theme_selected} |
---|
959 | </select> |
---|
960 | </div> |
---|
961 | |
---|
962 | {* language *} |
---|
963 | <div id="action_language" class="bulkAction"> |
---|
964 | <select name="language" size="1"> |
---|
965 | {html_options options=$language_options selected=$language_selected} |
---|
966 | </select> |
---|
967 | </div> |
---|
968 | |
---|
969 | {* recent_period *} |
---|
970 | <div id="action_recent_period" class="bulkAction"> |
---|
971 | <input type="text" size="3" maxlength="2" name="recent_period" value="{$RECENT_PERIOD}"> |
---|
972 | </div> |
---|
973 | |
---|
974 | {* expand *} |
---|
975 | <div id="action_expand" class="bulkAction"> |
---|
976 | <label><input type="radio" name="expand" value="true">{'Yes'|@translate}</label> |
---|
977 | <label><input type="radio" name="expand" value="false" checked="checked">{'No'|@translate}</label> |
---|
978 | </div> |
---|
979 | |
---|
980 | {* show_nb_comments *} |
---|
981 | <div id="action_show_nb_comments" class="bulkAction"> |
---|
982 | <label><input type="radio" name="show_nb_comments" value="true">{'Yes'|@translate}</label> |
---|
983 | <label><input type="radio" name="show_nb_comments" value="false" checked="checked">{'No'|@translate}</label> |
---|
984 | </div> |
---|
985 | |
---|
986 | {* show_nb_hits *} |
---|
987 | <div id="action_show_nb_hits" class="bulkAction"> |
---|
988 | <label><input type="radio" name="show_nb_hits" value="true">{'Yes'|@translate}</label> |
---|
989 | <label><input type="radio" name="show_nb_hits" value="false" checked="checked">{'No'|@translate}</label> |
---|
990 | </div> |
---|
991 | |
---|
992 | <p id="applyActionBlock" style="display:none" class="actionButtons"> |
---|
993 | <input id="applyAction" class="submit" type="submit" value="{'Apply action'|@translate}" name="submit"> <span id="applyOnDetails"></span> |
---|
994 | <span id="applyActionLoading" style="display:none"><img src="themes/default/images/ajax-loader-small.gif"></span> |
---|
995 | <span class="infos" style="display:none">✔ Users modified</span> |
---|
996 | </p> |
---|
997 | |
---|
998 | </div> {* #permitAction *} |
---|
999 | </fieldset> |
---|
1000 | |
---|
1001 | </form> |
---|