1 | {combine_css path=$USER_COLLEC_PATH|@cat:"admin/template/style.css"} |
---|
2 | |
---|
3 | {footer_script require='jquery.ui.sortable'}{literal} |
---|
4 | $( "#fields_active, #fields_inactive" ).sortable({ |
---|
5 | connectWith: ".connectedSortable", |
---|
6 | items: "> li", |
---|
7 | placeholder: "sortable-moving" |
---|
8 | }).disableSelection(); |
---|
9 | |
---|
10 | $("input[name='generate']").click(function() { |
---|
11 | query = "ws.php?format=rest&method=pwg.collections.getSerialized&col_id={/literal}{$COL_ID}{literal}"; |
---|
12 | $("#fields_active li").each(function() { |
---|
13 | query+= '&content[]='+ $(this).data('name'); |
---|
14 | }); |
---|
15 | |
---|
16 | $("#iframeWrapper").show(); |
---|
17 | $("#invokeFrame").attr('src', query); |
---|
18 | |
---|
19 | return false; |
---|
20 | }); |
---|
21 | |
---|
22 | $("#invokeFrame").load(function() { |
---|
23 | $(this).css('height', $(this).contents().find('body').outerHeight(true)+10); |
---|
24 | }); |
---|
25 | |
---|
26 | $("input[name='download']").click(function() { |
---|
27 | $("#fields_active li").each(function() { |
---|
28 | $("#export_form").append('<input type="hidden" name="active[]" value="'+ $(this).data('name') +'"/>'); |
---|
29 | }); |
---|
30 | $("#fields_inactive li").each(function() { |
---|
31 | $("#export_form").append('<input type="hidden" name="inactive[]" value="'+ $(this).data('name') +'"/>'); |
---|
32 | }); |
---|
33 | }); |
---|
34 | {/literal}{/footer_script} |
---|
35 | |
---|
36 | <div class="titrePage"> |
---|
37 | <h2>User Collections</h2> |
---|
38 | </div> |
---|
39 | |
---|
40 | {if $COL_ID} |
---|
41 | <form method="post" action="" class="properties" id="export_form"> |
---|
42 | <fieldset> |
---|
43 | <legend>{'Fields'|@translate}</legend> |
---|
44 | <ul id="fields_active" class="connectedSortable"> |
---|
45 | <h4>{'Active'|@translate}</h4> |
---|
46 | {foreach from=$active_fields item=field} |
---|
47 | <li data-name="{$field}"><img src="{$themeconf.admin_icon_dir}/cat_move.png"> {$field}</li> |
---|
48 | {/foreach} |
---|
49 | </ul> |
---|
50 | <ul id="fields_inactive" class="connectedSortable"> |
---|
51 | <h4>{'Inactive'|@translate}</h4> |
---|
52 | {foreach from=$inactive_fields item=field} |
---|
53 | <li data-name="{$field}"><img src="{$themeconf.admin_icon_dir}/cat_move.png"> {$field}</li> |
---|
54 | {/foreach} |
---|
55 | </ul> |
---|
56 | |
---|
57 | <p class="formButtons"> |
---|
58 | <input type="submit" name="generate" value="{'Preview'|@translate}"> |
---|
59 | <input type="submit" name="download" value="{'Download CSV file'|@translate}"> |
---|
60 | </p> |
---|
61 | </fieldset> |
---|
62 | |
---|
63 | <fieldset id="iframeWrapper" style="display:none;"> |
---|
64 | <legend>{'Preview'|@translate}</legend> |
---|
65 | <iframe src="" id="invokeFrame" name="invokeFrame"></iframe> |
---|
66 | </fieldset> |
---|
67 | </form> |
---|
68 | {/if} |
---|