1 | |
---|
2 | {if $nbphotos==0} |
---|
3 | <p>{'lmt_caddie_is_empty_please_fill_it'|@translate}</p> |
---|
4 | {else} |
---|
5 | |
---|
6 | {literal} |
---|
7 | <script type="text/javascript"> |
---|
8 | $(document).data("nbsel", {/literal}{$nbphotos}{literal}); |
---|
9 | |
---|
10 | function loadpage(pagenum) |
---|
11 | { |
---|
12 | $("#list").html("<div style='margin:20px auto;text-align:center;'><img src='./plugins/GrumPluginClasses/icons/processing.gif'></div>"); |
---|
13 | |
---|
14 | $.ajax( |
---|
15 | { |
---|
16 | type: "POST", |
---|
17 | data: |
---|
18 | { |
---|
19 | ajaxfct:'admin.manage.list', |
---|
20 | numPage:pagenum |
---|
21 | }, |
---|
22 | url: "{/literal}{$datas.LMT_AJAX_URL_LIST}{literal}", |
---|
23 | async: true, |
---|
24 | success: function (msg) |
---|
25 | { |
---|
26 | $("#nbphotos").html(msg.substr(0,msg.indexOf("#"))); |
---|
27 | $("#list").html(msg.substr(msg.indexOf("#")+1)); |
---|
28 | } |
---|
29 | } |
---|
30 | ); |
---|
31 | } |
---|
32 | |
---|
33 | function swap_state(id) |
---|
34 | { |
---|
35 | if($("#"+id).val()=="1") |
---|
36 | { |
---|
37 | $("#"+id).val("0"); |
---|
38 | $("#img"+id).attr("className", "is_off"); |
---|
39 | $(document).data("nbsel", $(document).data("nbsel")-1); |
---|
40 | } |
---|
41 | else |
---|
42 | { |
---|
43 | $("#"+id).val("1"); |
---|
44 | $("#img"+id).attr("className", "is_on"); |
---|
45 | $(document).data("nbsel", $(document).data("nbsel")+1); |
---|
46 | } |
---|
47 | $("#btsubmit").get(0).disabled=($(document).data("nbsel")==0); |
---|
48 | } |
---|
49 | |
---|
50 | function change_select() |
---|
51 | { |
---|
52 | act=$("#selectlist").val(); |
---|
53 | switch(act) |
---|
54 | { |
---|
55 | case '-': |
---|
56 | break; |
---|
57 | case 'all': |
---|
58 | $(document).data("nbsel", {/literal}{$nbphotos}{literal}); |
---|
59 | $("input").filter(".none").each( |
---|
60 | function(i) |
---|
61 | { |
---|
62 | this.value="1"; |
---|
63 | $("#img"+this.id).attr("className", "is_on"); |
---|
64 | } |
---|
65 | ); |
---|
66 | break; |
---|
67 | case 'none': |
---|
68 | $(document).data("nbsel", 0); |
---|
69 | $("input").filter(".none").each( |
---|
70 | function(i) |
---|
71 | { |
---|
72 | this.value="0"; |
---|
73 | $("#img"+this.id).attr("className", "is_off"); |
---|
74 | } |
---|
75 | ); |
---|
76 | break; |
---|
77 | case 'invert': |
---|
78 | $("input").filter(".none").each( |
---|
79 | function(i) |
---|
80 | { |
---|
81 | if(this.value=="1") |
---|
82 | { |
---|
83 | this.value="0"; |
---|
84 | $("#img"+this.id).attr("className", "is_off"); |
---|
85 | $(document).data("nbsel", $(document).data("nbsel")-1); |
---|
86 | } |
---|
87 | else |
---|
88 | { |
---|
89 | this.value="1"; |
---|
90 | $("#img"+this.id).attr("className", "is_on"); |
---|
91 | $(document).data("nbsel", $(document).data("nbsel")+1); |
---|
92 | } |
---|
93 | } |
---|
94 | ); |
---|
95 | break; |
---|
96 | default: |
---|
97 | $(document).data("nbsel", 0); |
---|
98 | $("input").filter(".none").each( |
---|
99 | function(i) |
---|
100 | { |
---|
101 | if(this.alt==act) |
---|
102 | { |
---|
103 | this.value="1"; |
---|
104 | $("#img"+this.id).attr("className", "is_on"); |
---|
105 | $(document).data("nbsel", $(document).data("nbsel")+1); |
---|
106 | } |
---|
107 | } |
---|
108 | ); |
---|
109 | break; |
---|
110 | } |
---|
111 | $("#selectlist").get(0).options[0].selected=true; |
---|
112 | $("#btsubmit").get(0).disabled=($(document).data("nbsel")==0); |
---|
113 | } |
---|
114 | |
---|
115 | </script> |
---|
116 | {/literal} |
---|
117 | |
---|
118 | |
---|
119 | <form method="POST"> |
---|
120 | |
---|
121 | <fieldset> |
---|
122 | <legend>{'lmt_caddie_items'|@translate}</legend> |
---|
123 | |
---|
124 | <div id="list"> |
---|
125 | </div> |
---|
126 | |
---|
127 | <p class="lmt_page" style="border-top:1px dotted;padding-top:10px;"> |
---|
128 | <span id="nbphotos" style="float:right;"></span> |
---|
129 | <span> |
---|
130 | <select id="selectlist" onchange="change_select();"> |
---|
131 | {html_options values=$selectlist_list_values output=$selectlist_list_labels selected=$selectlist_list_selected} |
---|
132 | </select> |
---|
133 | </span> |
---|
134 | </p> |
---|
135 | </fieldset> |
---|
136 | |
---|
137 | <fieldset> |
---|
138 | <legend>{'lmt_licence_to_apply'|@translate}</legend> |
---|
139 | |
---|
140 | <p class="lmt_page"> |
---|
141 | <table class="formtable"> |
---|
142 | <tr> |
---|
143 | <td>{'lmt_licence'|@translate}</td> |
---|
144 | <td> |
---|
145 | <select name="licence"> |
---|
146 | {html_options values=$licences_list_values output=$licences_list_labels selected=$licences_list_selected} |
---|
147 | </select> |
---|
148 | </td> |
---|
149 | </tr> |
---|
150 | <tr> |
---|
151 | <td>{'lmt_author'|@translate}</td> |
---|
152 | <td> |
---|
153 | <select name="author"> |
---|
154 | {html_options values=$author_list_values output=$author_list_labels} |
---|
155 | </select> |
---|
156 | </td> |
---|
157 | </tr> |
---|
158 | </table> |
---|
159 | </p> |
---|
160 | </fieldset> |
---|
161 | |
---|
162 | <fieldset> |
---|
163 | <legend>{'Caddie management'|@translate}</legend> |
---|
164 | <label><input type="radio" name="manage_caddie" value="app_nothing" checked> {'lmt_apply_do_nothing'|@translate}</label><br/> |
---|
165 | <label><input type="radio" name="manage_caddie" value="app_clear"> {'lmt_apply_do_clear'|@translate}</label><br/> |
---|
166 | <label><input type="radio" name="manage_caddie" value="app_clear_selected"> {'lmt_apply_do_clear_selected'|@translate}</label><br/> |
---|
167 | <label><input type="radio" name="manage_caddie" value="napp_clear_selected"> {'lmt_dontapply_do_clear_selected'|@translate}</label><br/> |
---|
168 | </fieldset> |
---|
169 | |
---|
170 | <p><input type="submit" id="btsubmit" name="submit_apply_licence" value="{'lmt_apply'|@translate}"></p> |
---|
171 | |
---|
172 | </form> |
---|
173 | |
---|
174 | <script type="text/javascript"> |
---|
175 | loadpage(1); |
---|
176 | </script> |
---|
177 | |
---|
178 | {/if} |
---|