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 | $("input[name='download']").click(function() { |
---|
23 | $("#fields_active li").each(function() { |
---|
24 | $("#export_form").append('<input type="hidden" name="content[]" value="'+ $(this).data('name') +'"/>'); |
---|
25 | }); |
---|
26 | }); |
---|
27 | {/literal}{/footer_script} |
---|
28 | |
---|
29 | <div class="titrePage"> |
---|
30 | <h2>User Collections</h2> |
---|
31 | </div> |
---|
32 | |
---|
33 | {if $COL_ID} |
---|
34 | <form method="post" action="" class="properties" id="export_form"> |
---|
35 | <fieldset> |
---|
36 | <legend>{'Fields'|@translate}</legend> |
---|
37 | <ul id="fields_active" class="connectedSortable"> |
---|
38 | <h4>{'Active'|@translate}</h4> |
---|
39 | <li data-name="id"><img src="{$themeconf.admin_icon_dir}/cat_move.png"> id</li> |
---|
40 | <li data-name="name"><img src="{$themeconf.admin_icon_dir}/cat_move.png"> name</li> |
---|
41 | <li data-name="path"><img src="{$themeconf.admin_icon_dir}/cat_move.png"> path</li> |
---|
42 | </ul> |
---|
43 | <ul id="fields_inactive" class="connectedSortable"> |
---|
44 | <h4>{'Inactive'|@translate}</h4> |
---|
45 | <li data-name="file"><img src="{$themeconf.admin_icon_dir}/cat_move.png"> file</li> |
---|
46 | <li data-name="url"><img src="{$themeconf.admin_icon_dir}/cat_move.png"> url</li> |
---|
47 | </ul> |
---|
48 | |
---|
49 | <p class="formButtons"> |
---|
50 | <input type="submit" name="generate" value="{'Generate'|@translate}"> |
---|
51 | <input type="submit" name="download" value="{'Download CSV file'|@translate}"> |
---|
52 | </p> |
---|
53 | </fieldset> |
---|
54 | |
---|
55 | <fieldset id="iframeWrapper" style="display:none;"> |
---|
56 | <legend>{'Output'|@translate}</legend> |
---|
57 | <iframe src="" id="invokeFrame" name="invokeFrame"></iframe> |
---|
58 | </fieldset> |
---|
59 | </form> |
---|
60 | {/if} |
---|