1 | {combine_script id='common' load='footer' path='admin/themes/default/js/common.js'} |
---|
2 | |
---|
3 | {footer_script} |
---|
4 | (function(){ |
---|
5 | var labelMaxWidth = "{'Maximum width'|translate}", |
---|
6 | labelWidth = "{'Width'|translate}", |
---|
7 | labelMaxHeight = "{'Maximum height'|translate}", |
---|
8 | labelHeight = "{'Height'|translate}"; |
---|
9 | |
---|
10 | function toggleResizeFields(size) { |
---|
11 | var checkbox = jQuery("[name=original_resize]"); |
---|
12 | var needToggle = jQuery("#sizeEdit-original"); |
---|
13 | |
---|
14 | if (jQuery(checkbox).is(':checked')) { |
---|
15 | needToggle.show(); |
---|
16 | } |
---|
17 | else { |
---|
18 | needToggle.hide(); |
---|
19 | } |
---|
20 | } |
---|
21 | |
---|
22 | toggleResizeFields("original"); |
---|
23 | jQuery("[name=original_resize]").click(function () { |
---|
24 | toggleResizeFields("original"); |
---|
25 | }); |
---|
26 | |
---|
27 | jQuery("a[id^='sizeEditOpen-']").click(function(){ |
---|
28 | var sizeName = jQuery(this).attr("id").split("-")[1]; |
---|
29 | jQuery("#sizeEdit-"+sizeName).toggle(); |
---|
30 | jQuery(this).hide(); |
---|
31 | return false; |
---|
32 | }); |
---|
33 | |
---|
34 | jQuery(".cropToggle").click(function() { |
---|
35 | var labelBoxWidth = jQuery(this).parents('table.sizeEditForm').find('td.sizeEditWidth'); |
---|
36 | var labelBoxHeight = jQuery(this).parents('table.sizeEditForm').find('td.sizeEditHeight'); |
---|
37 | |
---|
38 | if (jQuery(this).is(':checked')) { |
---|
39 | jQuery(labelBoxWidth).html(labelWidth); |
---|
40 | jQuery(labelBoxHeight).html(labelHeight); |
---|
41 | } |
---|
42 | else { |
---|
43 | jQuery(labelBoxWidth).html(labelMaxWidth); |
---|
44 | jQuery(labelBoxHeight).html(labelMaxHeight); |
---|
45 | } |
---|
46 | }); |
---|
47 | |
---|
48 | jQuery("#showDetails").click(function() { |
---|
49 | jQuery(".sizeDetails").show(); |
---|
50 | jQuery(this).css("visibility", "hidden"); |
---|
51 | return false; |
---|
52 | }); |
---|
53 | }()); |
---|
54 | {/footer_script} |
---|
55 | |
---|
56 | {html_style} |
---|
57 | .sizeEnable { width:50px; } |
---|
58 | .sizeEnable .icon-ok { position:relative; left:2px; } |
---|
59 | .sizeEditForm { margin:0 0 10px 20px; } |
---|
60 | .sizeEdit { display:none; } |
---|
61 | #sizesConf table { margin:0; } |
---|
62 | .showDetails { padding:0; } |
---|
63 | .sizeDetails { display:none;margin-left:10px; } |
---|
64 | .sizeEditOpen { margin-left:10px; } |
---|
65 | {/html_style} |
---|
66 | |
---|
67 | <h2>{'Piwigo configuration'|translate} {$TABSHEET_TITLE}</h2> |
---|
68 | |
---|
69 | <form method="post" action="{$F_ACTION}" class="properties"> |
---|
70 | |
---|
71 | <div id="configContent"> |
---|
72 | |
---|
73 | <fieldset id="sizesConf"> |
---|
74 | <legend>{'Original Size'|translate}</legend> |
---|
75 | {if $is_gd} |
---|
76 | <div> |
---|
77 | {'Resize after upload disabled due to the use of GD as graphic library'|translate} |
---|
78 | <input type="checkbox" name="original_resize"disabled="disabled" style="visibility: hidden"> |
---|
79 | <input type="hidden" name="original_resize_maxwidth" value="{$sizes.original_resize_maxwidth}"> |
---|
80 | <input type="hidden" name="original_resize_maxheight" value="{$sizes.original_resize_maxheight}"> |
---|
81 | <input type="hidden" name="original_resize_quality" value="{$sizes.original_resize_quality}"> |
---|
82 | </div> |
---|
83 | {else} |
---|
84 | <div> |
---|
85 | <label class="font-checkbox"> |
---|
86 | <span class="icon-check"></span> |
---|
87 | <input type="checkbox" name="original_resize" {if ($sizes.original_resize)}checked="checked"{/if}> |
---|
88 | {'Resize after upload'|translate} |
---|
89 | </label> |
---|
90 | </div> |
---|
91 | |
---|
92 | <table id="sizeEdit-original"> |
---|
93 | <tr> |
---|
94 | <th>{'Maximum width'|translate}</th> |
---|
95 | <td> |
---|
96 | <input type="text" name="original_resize_maxwidth" value="{$sizes.original_resize_maxwidth}" size="4" maxlength="4"{if isset($ferrors.original_resize_maxwidth)} class="dError"{/if}> {'pixels'|translate} |
---|
97 | {if isset($ferrors.original_resize_maxwidth)}<span class="dErrorDesc" title="{$ferrors.original_resize_maxwidth}">!</span>{/if} |
---|
98 | </td> |
---|
99 | </tr> |
---|
100 | <tr> |
---|
101 | <th>{'Maximum height'|translate}</th> |
---|
102 | <td> |
---|
103 | <input type="text" name="original_resize_maxheight" value="{$sizes.original_resize_maxheight}" size="4" maxlength="4"{if isset($ferrors.original_resize_maxheight)} class="dError"{/if}> {'pixels'|translate} |
---|
104 | {if isset($ferrors.original_resize_maxheight)}<span class="dErrorDesc" title="{$ferrors.original_resize_maxheight}">!</span>{/if} |
---|
105 | </td> |
---|
106 | </tr> |
---|
107 | <tr> |
---|
108 | <th>{'Image Quality'|translate}</th> |
---|
109 | <td> |
---|
110 | <input type="text" name="original_resize_quality" value="{$sizes.original_resize_quality}" size="3" maxlength="3"{if isset($ferrors.original_resize_quality)} class="dError"{/if}> % |
---|
111 | {if isset($ferrors.original_resize_quality)}<span class="dErrorDesc" title="{$ferrors.original_resize_quality}">!</span>{/if} |
---|
112 | </td> |
---|
113 | </tr> |
---|
114 | </table> |
---|
115 | {/if} |
---|
116 | </fieldset> |
---|
117 | |
---|
118 | <fieldset id="multiSizesConf"> |
---|
119 | <legend>{'Multiple Size'|translate}</legend> |
---|
120 | |
---|
121 | <div class="showDetails"> |
---|
122 | <a href="#" id="showDetails"{if isset($ferrors)} style="display:none"{/if}>{'show details'|translate}</a> |
---|
123 | </div> |
---|
124 | |
---|
125 | <table style="margin:0"> |
---|
126 | {foreach from=$derivatives item=d key=type} |
---|
127 | <tr> |
---|
128 | <td> |
---|
129 | <label> |
---|
130 | {if $d.must_enable} |
---|
131 | <span class="sizeEnable"> |
---|
132 | <span class="icon-ok"></span> |
---|
133 | </span> |
---|
134 | {else} |
---|
135 | <span class="sizeEnable font-checkbox"> |
---|
136 | <span class="icon-check"></span> |
---|
137 | <input type="checkbox" name="d[{$type}][enabled]" {if $d.enabled}checked="checked"{/if}> |
---|
138 | </span> |
---|
139 | {/if} |
---|
140 | {$type|translate} |
---|
141 | </label> |
---|
142 | </td> |
---|
143 | |
---|
144 | <td> |
---|
145 | <span class="sizeDetails"{if isset($ferrors)} style="display:inline"{/if}>{$d.w} x {$d.h} {'pixels'|translate}{if $d.crop}, {'Crop'|translate|lower}{/if}</span> |
---|
146 | </td> |
---|
147 | |
---|
148 | <td> |
---|
149 | <span class="sizeDetails"{if isset($ferrors) and !isset($ferrors.$type)} style="display:inline"{/if}> |
---|
150 | <a href="#" id="sizeEditOpen-{$type}" class="sizeEditOpen">{'edit'|translate}</a> |
---|
151 | </span> |
---|
152 | </td> |
---|
153 | </tr> |
---|
154 | |
---|
155 | <tr id="sizeEdit-{$type}" class="sizeEdit" {if isset($ferrors.$type)} style="display:block"{/if}> |
---|
156 | <td colspan="3"> |
---|
157 | <table class="sizeEditForm"> |
---|
158 | {if !$d.must_square} |
---|
159 | <tr> |
---|
160 | <td colspan="2"> |
---|
161 | <label class="font-checkbox"> |
---|
162 | <span class="icon-check"></span> |
---|
163 | <input type="checkbox" class="cropToggle" name="d[{$type}][crop]" {if $d.crop}checked="checked"{/if}> |
---|
164 | {'Crop'|translate} |
---|
165 | </label> |
---|
166 | </td> |
---|
167 | </tr> |
---|
168 | {/if} |
---|
169 | <tr> |
---|
170 | <td class="sizeEditWidth">{if $d.must_square or $d.crop}{'Width'|translate}{else}{'Maximum width'|translate}{/if}</td> |
---|
171 | <td> |
---|
172 | <input type="text" name="d[{$type}][w]" maxlength="4" size="4" value="{$d.w}"{if isset($ferrors.$type.w)} class="dError"{/if}> {'pixels'|translate} |
---|
173 | {if isset($ferrors.$type.w)}<span class="dErrorDesc" title="{$ferrors.$type.w}">!</span>{/if} |
---|
174 | </td> |
---|
175 | </tr> |
---|
176 | {if !$d.must_square} |
---|
177 | <tr> |
---|
178 | <td class="sizeEditHeight">{if $d.crop}{'Height'|translate}{else}{'Maximum height'|translate}{/if}</td> |
---|
179 | <td> |
---|
180 | <input type="text" name="d[{$type}][h]" maxlength="4" size="4" value="{$d.h}"{if isset($ferrors.$type.h)} class="dError"{/if}> {'pixels'|translate} |
---|
181 | {if isset($ferrors.$type.h)}<span class="dErrorDesc" title="{$ferrors.$type.h}">!</span>{/if} |
---|
182 | </td> |
---|
183 | </tr> |
---|
184 | {/if} |
---|
185 | <tr> |
---|
186 | <td>{'Sharpen'|translate}</td> |
---|
187 | <td> |
---|
188 | <input type="text" name="d[{$type}][sharpen]" maxlength="4" size="4" value="{$d.sharpen}"{if isset($ferrors.$type.sharpen)} class="dError"{/if}> % |
---|
189 | {if isset($ferrors.$type.sharpen)}<span class="dErrorDesc" title="{$ferrors.$type.sharpen}">!</span>{/if} |
---|
190 | </td> |
---|
191 | </tr> |
---|
192 | </table> {* #sizeEdit *} |
---|
193 | </td> |
---|
194 | </tr> |
---|
195 | {/foreach} |
---|
196 | </table> |
---|
197 | |
---|
198 | <p style="margin:10px 0 0 0;{if isset($ferrors)} display:block;{/if}" class="sizeDetails"> |
---|
199 | {'Image Quality'|translate} |
---|
200 | <input type="text" name="resize_quality" value="{$resize_quality}" size="3" maxlength="3"{if isset($ferrors.resize_quality)} class="dError"{/if}> % |
---|
201 | {if isset($ferrors.resize_quality)}<span class="dErrorDesc" title="{$ferrors.resize_quality}">!</span>{/if} |
---|
202 | </p> |
---|
203 | <p style="margin:10px 0 0 0;{if isset($ferrors)} display:block;{/if}" class="sizeDetails"> |
---|
204 | <a href="{$F_ACTION}&action=restore_settings" onclick="return confirm('{'Are you sure?'|translate|@escape:javascript}');">{'Reset to default values'|translate}</a> |
---|
205 | </p> |
---|
206 | |
---|
207 | {if !empty($custom_derivatives)} |
---|
208 | <fieldset class="sizeDetails"> |
---|
209 | <legend>{'custom'|translate}</legend> |
---|
210 | |
---|
211 | <table style="margin:0"> |
---|
212 | {foreach from=$custom_derivatives item=time key=custom} |
---|
213 | <tr><td> |
---|
214 | <label class="font-checkbox"> |
---|
215 | <span class="icon-check"></span> |
---|
216 | <input type="checkbox" name="delete_custom_derivative_{$custom}"> {'Delete'|translate} {$custom} ({'Last hit'|translate}: {$time}) |
---|
217 | </label> |
---|
218 | </td></tr> |
---|
219 | {/foreach} |
---|
220 | </table> |
---|
221 | </fieldset> |
---|
222 | {/if} |
---|
223 | |
---|
224 | </fieldset> |
---|
225 | |
---|
226 | </div> <!-- configContent --> |
---|
227 | |
---|
228 | <p class="formButtons"> |
---|
229 | <input type="submit" name="submit" value="{'Save Settings'|translate}"> |
---|
230 | </p> |
---|
231 | |
---|
232 | </form> |
---|