1 | {combine_script id='common' load='footer' path='admin/themes/default/js/common.js'} |
---|
2 | |
---|
3 | {footer_script} |
---|
4 | (function(){ |
---|
5 | function onWatermarkChange() { |
---|
6 | var val = jQuery("#wSelect").val(); |
---|
7 | if (val.length) { |
---|
8 | jQuery("#wImg").attr('src', '{$ROOT_URL}'+val).show(); |
---|
9 | } |
---|
10 | else { |
---|
11 | jQuery("#wImg").hide(); |
---|
12 | } |
---|
13 | } |
---|
14 | |
---|
15 | onWatermarkChange(); |
---|
16 | |
---|
17 | jQuery("#wSelect").bind("change", onWatermarkChange); |
---|
18 | |
---|
19 | if (jQuery("input[name='w[position]']:checked").val() == 'custom') { |
---|
20 | jQuery("#positionCustomDetails").show(); |
---|
21 | } |
---|
22 | |
---|
23 | jQuery("input[name='w[position]']").change(function(){ |
---|
24 | if (jQuery(this).val() == 'custom') { |
---|
25 | jQuery("#positionCustomDetails").show(); |
---|
26 | } |
---|
27 | else { |
---|
28 | jQuery("#positionCustomDetails").hide(); |
---|
29 | } |
---|
30 | }); |
---|
31 | |
---|
32 | jQuery(".addWatermarkOpen").click(function(){ |
---|
33 | jQuery("#addWatermark, #selectWatermark").toggle(); |
---|
34 | return false; |
---|
35 | }); |
---|
36 | }()); |
---|
37 | {/footer_script} |
---|
38 | |
---|
39 | <h2>{'Piwigo configuration'|translate} {$TABSHEET_TITLE}</h2> |
---|
40 | |
---|
41 | <form method="post" action="{$F_ACTION}" class="properties" enctype="multipart/form-data"> |
---|
42 | |
---|
43 | <div id="configContent"> |
---|
44 | |
---|
45 | <fieldset id="watermarkConf" class="no-border"> |
---|
46 | <legend></legend> |
---|
47 | <ul> |
---|
48 | <li> |
---|
49 | <span id="selectWatermark"{if isset($ferrors.watermarkImage)} style="display:none"{/if}><label>{'Select a file'|translate}</label> |
---|
50 | <select name="w[file]" id="wSelect"> |
---|
51 | {html_options options=$watermark_files selected=$watermark.file} |
---|
52 | </select> |
---|
53 | |
---|
54 | {'... or '|translate}<a href="#" class="addWatermarkOpen">{'add a new watermark'|translate}</a> |
---|
55 | <br> |
---|
56 | <img id="wImg"></img> |
---|
57 | </span> |
---|
58 | |
---|
59 | <span id="addWatermark"{if isset($ferrors.watermarkImage)} style="display:inline"{/if}> |
---|
60 | {'add a new watermark'|translate} {'... or '|translate}<a href="#" class="addWatermarkOpen">{'Select a file'|translate}</a> |
---|
61 | |
---|
62 | <br> |
---|
63 | <input type="file" size="60" id="watermarkImage" name="watermarkImage"{if isset($ferrors.watermarkImage)} class="dError"{/if}> (png) |
---|
64 | {if isset($ferrors.watermarkImage)}<span class="dErrorDesc" title="{$ferrors.watermarkImage|@htmlspecialchars}">!</span>{/if} |
---|
65 | </span> |
---|
66 | </li> |
---|
67 | |
---|
68 | <li> |
---|
69 | <label> |
---|
70 | {'Apply watermark if width is bigger than'|translate} |
---|
71 | <input size="4" maxlength="4" type="text" name="w[minw]" value="{$watermark.minw}"{if isset($ferrors.watermark.minw)} class="dError"{/if}> |
---|
72 | </label> |
---|
73 | {'pixels'|translate} |
---|
74 | </li> |
---|
75 | |
---|
76 | <li> |
---|
77 | <label> |
---|
78 | {'Apply watermark if height is bigger than'|translate} |
---|
79 | <input size="4" maxlength="4" type="text" name="w[minh]" value="{$watermark.minh}"{if isset($ferrors.watermark.minh)} class="dError"{/if}> |
---|
80 | </label> |
---|
81 | {'pixels'|translate} |
---|
82 | </li> |
---|
83 | |
---|
84 | <li> |
---|
85 | <label>{'Position'|translate}</label> |
---|
86 | <br> |
---|
87 | <div id="watermarkPositionBox"> |
---|
88 | <label class="right">{'top right corner'|translate} <input name="w[position]" type="radio" value="topright"{if $watermark.position eq 'topright'} checked="checked"{/if}></label> |
---|
89 | <label><input name="w[position]" type="radio" value="topleft"{if $watermark.position eq 'topleft'} checked="checked"{/if}> {'top left corner'|translate}</label> |
---|
90 | <label class="middle"><input name="w[position]" type="radio" value="middle"{if $watermark.position eq 'middle'} checked="checked"{/if}> {'middle'|translate}</label> |
---|
91 | <label class="right">{'bottom right corner'|translate} <input name="w[position]" type="radio" value="bottomright"{if $watermark.position eq 'bottomright'} checked="checked"{/if}></label> |
---|
92 | <label><input name="w[position]" type="radio" value="bottomleft"{if $watermark.position eq 'bottomleft'} checked="checked"{/if}> {'bottom left corner'|translate}</label> |
---|
93 | </div> |
---|
94 | |
---|
95 | <label style="display:block;margin-top:10px;font-weight:normal;"><input name="w[position]" type="radio" value="custom"{if $watermark.position eq 'custom'} checked="checked"{/if}> {'custom'|translate}</label> |
---|
96 | |
---|
97 | <div id="positionCustomDetails"> |
---|
98 | <label>{'X Position'|translate} |
---|
99 | <input size="3" maxlength="3" type="text" name="w[xpos]" value="{$watermark.xpos}"{if isset($ferrors.watermark.xpos)} class="dError"{/if}>% |
---|
100 | {if isset($ferrors.watermark.xpos)}<span class="dErrorDesc" title="{$ferrors.watermark.xpos}">!</span>{/if} |
---|
101 | </label> |
---|
102 | |
---|
103 | <br> |
---|
104 | <label>{'Y Position'|translate} |
---|
105 | <input size="3" maxlength="3" type="text" name="w[ypos]" value="{$watermark.ypos}"{if isset($ferrors.watermark.ypos)} class="dError"{/if}>% |
---|
106 | {if isset($ferrors.watermark.ypos)}<span class="dErrorDesc" title="{$ferrors.watermark.ypos}">!</span>{/if} |
---|
107 | </label> |
---|
108 | |
---|
109 | <br> |
---|
110 | <label>{'X Repeat'|translate} |
---|
111 | <input size="3" maxlength="3" type="text" name="w[xrepeat]" value="{$watermark.xrepeat}"{if isset($ferrors.watermark.xrepeat)} class="dError"{/if}> |
---|
112 | {if isset($ferrors.watermark.xrepeat)}<span class="dErrorDesc" title="{$ferrors.watermark.xrepeat}">!</span>{/if} |
---|
113 | </label> |
---|
114 | </div> |
---|
115 | </li> |
---|
116 | |
---|
117 | <li> |
---|
118 | <label>{'Opacity'|translate}</label> |
---|
119 | <input size="3" maxlength="3" type="text" name="w[opacity]" value="{$watermark.opacity}"{if isset($ferrors.watermark.opacity)} class="dError"{/if}> % |
---|
120 | {if isset($ferrors.watermark.opacity)}<span class="dErrorDesc" title="{$ferrors.watermark.opacity}">!</span>{/if} |
---|
121 | </li> |
---|
122 | </ul> |
---|
123 | </fieldset> |
---|
124 | |
---|
125 | </div> <!-- configContent --> |
---|
126 | |
---|
127 | <p class="formButtons"> |
---|
128 | <input type="submit" name="submit" value="{'Save Settings'|translate}"> |
---|
129 | </p> |
---|
130 | |
---|
131 | </form> |
---|