1 | {known_script id="jquery" src=$ROOT_URL|@cat:"template-common/lib/jquery.packed.js"} |
---|
2 | |
---|
3 | {literal} |
---|
4 | <script> |
---|
5 | $(document).ready(function(){ |
---|
6 | |
---|
7 | $("input[name=category_type]").click(function () { |
---|
8 | $("[id^=category_type_]").hide(); |
---|
9 | $("#category_type_"+$(this).attr("value")).show(); |
---|
10 | }); |
---|
11 | |
---|
12 | }); |
---|
13 | </script> |
---|
14 | {/literal} |
---|
15 | |
---|
16 | {if $upload_mode eq 'html'} |
---|
17 | <script type="text/javascript" src="{$plugin_path}include/upload.js"></script> |
---|
18 | {elseif $upload_mode eq 'multiple'} |
---|
19 | <script type="text/javascript" src="{$plugin_path}uploadify/swfobject.js"></script> |
---|
20 | <script type="text/javascript" src="{$plugin_path}uploadify/jquery.uploadify.v2.1.0.min.js"></script> |
---|
21 | |
---|
22 | <script type="text/javascript"> |
---|
23 | var basepath = '{$plugin_path}'; |
---|
24 | var upload_id = '{$upload_id}'; |
---|
25 | var session_id = '{$session_id}'; |
---|
26 | var pwg_token = '{$pwg_token}'; |
---|
27 | var buttonText = '{"Select files"|@translate}'; |
---|
28 | |
---|
29 | {literal} |
---|
30 | jQuery(document).ready(function() { |
---|
31 | jQuery("#uploadify").uploadify({ |
---|
32 | 'uploader' : basepath + 'uploadify/uploadify.swf', |
---|
33 | 'script' : basepath + 'uploadify/uploadify.php', |
---|
34 | 'scriptData' : { |
---|
35 | 'upload_id' : upload_id, |
---|
36 | 'session_id' : session_id, |
---|
37 | 'pwg_token' : pwg_token, |
---|
38 | }, |
---|
39 | 'cancelImg' : basepath + 'uploadify/cancel.png', |
---|
40 | 'queueID' : 'fileQueue', |
---|
41 | 'auto' : false, |
---|
42 | 'displayData' : 'speed', |
---|
43 | 'buttonText' : buttonText, |
---|
44 | 'multi' : true, |
---|
45 | 'onAllComplete' : function(event, data) { |
---|
46 | if (data.errors) { |
---|
47 | return false; |
---|
48 | } |
---|
49 | else { |
---|
50 | $("input[name=submit_upload]").click(); |
---|
51 | } |
---|
52 | } |
---|
53 | }); |
---|
54 | }); |
---|
55 | {/literal} |
---|
56 | </script> |
---|
57 | {/if} |
---|
58 | |
---|
59 | {literal} |
---|
60 | <style> |
---|
61 | #uploadBoxes P { |
---|
62 | margin:0; |
---|
63 | margin-bottom:2px; |
---|
64 | padding:0; |
---|
65 | } |
---|
66 | |
---|
67 | #batchLink { |
---|
68 | text-align:center; |
---|
69 | } |
---|
70 | </style> |
---|
71 | {/literal} |
---|
72 | |
---|
73 | <div class="titrePage"> |
---|
74 | <h2>{'Upload Form'|@translate}</h2> |
---|
75 | </div> |
---|
76 | |
---|
77 | {if count($setup_errors) > 0} |
---|
78 | <div class="errors"> |
---|
79 | <ul> |
---|
80 | {foreach from=$setup_errors item=error} |
---|
81 | <li>{$error}</li> |
---|
82 | {/foreach} |
---|
83 | </ul> |
---|
84 | </div> |
---|
85 | {else} |
---|
86 | |
---|
87 | {if !empty($thumbnails)} |
---|
88 | <fieldset> |
---|
89 | <legend>{'Uploaded Photos'|@translate}</legend> |
---|
90 | <div> |
---|
91 | {foreach from=$thumbnails item=thumbnail} |
---|
92 | <a href="{$thumbnail.link}" onclick="window.open(this.href); return false;"> |
---|
93 | <img src="{$thumbnail.src}" alt="{$thumbnail.file}" title="{$thumbnail.title}" class="thumbnail"> |
---|
94 | </a> |
---|
95 | {/foreach} |
---|
96 | </div> |
---|
97 | <p id="batchLink"><a href="{$batch_link}">{$batch_label}</a></p> |
---|
98 | </fieldset> |
---|
99 | {/if} |
---|
100 | |
---|
101 | |
---|
102 | <form id="uploadForm" enctype="multipart/form-data" method="post" action="{$F_ACTION}" class="properties"> |
---|
103 | {if $upload_mode eq 'multiple'} |
---|
104 | <input name="upload_id" value="{$upload_id}" type="hidden"> |
---|
105 | {/if} |
---|
106 | <fieldset> |
---|
107 | <legend>{'Upload Photos'|@translate}</legend> |
---|
108 | |
---|
109 | <table> |
---|
110 | <tr> |
---|
111 | <th>{'Drop into category'|@translate}</th> |
---|
112 | <td> |
---|
113 | <label><input type="radio" name="category_type" value="existing" checked="checked"> {'existing category'|@translate}</label> |
---|
114 | <label><input type="radio" name="category_type" value="new"> {'create a new category'|@translate}</label> |
---|
115 | |
---|
116 | <div id="category_type_existing"> |
---|
117 | <select class="categoryDropDown" name="category"> |
---|
118 | {html_options options=$category_options} |
---|
119 | </select> |
---|
120 | </div> |
---|
121 | |
---|
122 | <div id="category_type_new" style="display:none"> |
---|
123 | <table> |
---|
124 | <tr> |
---|
125 | <td>{'Parent category'|@translate}</td> |
---|
126 | <td> |
---|
127 | <select class="categoryDropDown" name="category_parent"> |
---|
128 | <option value="0">------------</option> |
---|
129 | {html_options options=$category_options} |
---|
130 | </select> |
---|
131 | </td> |
---|
132 | </tr> |
---|
133 | <tr> |
---|
134 | <td>{'Category name'|@translate}</td> |
---|
135 | <td> |
---|
136 | <input type="text" name="category_name" value="{$F_CATEGORY_NAME}" |
---|
137 | </td> |
---|
138 | </tr> |
---|
139 | </table> |
---|
140 | </div> |
---|
141 | |
---|
142 | </td> |
---|
143 | </tr> |
---|
144 | |
---|
145 | <tr> |
---|
146 | <th>{'Who can see these photos?'|@translate}</th> |
---|
147 | <td> |
---|
148 | <select name="level" size="1"> |
---|
149 | {html_options options=$level_options selected=$level_options_selected} |
---|
150 | </select> |
---|
151 | </td> |
---|
152 | </tr> |
---|
153 | |
---|
154 | {if $upload_mode eq 'html'} |
---|
155 | <tr> |
---|
156 | <td colspan="2"> |
---|
157 | <strong>{'Select files'|@translate}</strong> |
---|
158 | <p>{'JPEG files or ZIP archives with JPEG files inside please.'|@translate}</p> |
---|
159 | <div id="uploadBoxes"> |
---|
160 | <p><input class="file" type="file" size="70" name="image_upload[]" /></p> |
---|
161 | </div> |
---|
162 | <div id="addUploadBox"> |
---|
163 | <a href="javascript: UpdateUploadSlots()">{'+ Add an upload box'|@translate}</a> |
---|
164 | </div> |
---|
165 | </td> |
---|
166 | </tr> |
---|
167 | |
---|
168 | </table> |
---|
169 | |
---|
170 | <p> |
---|
171 | <input class="submit" type="submit" name="submit_upload" value="{'Upload'|@translate}" {$TAG_INPUT_ENABLED}/> |
---|
172 | </p> |
---|
173 | {elseif $upload_mode eq 'multiple'} |
---|
174 | </table> |
---|
175 | |
---|
176 | <p> |
---|
177 | <input type="file" name="uploadify" id="uploadify" /> |
---|
178 | </p> |
---|
179 | |
---|
180 | <div id="fileQueue"></div> |
---|
181 | |
---|
182 | <p> |
---|
183 | <input class="submit" type="button" value="{'Upload'|@translate}" onclick="javascript:jQuery('#uploadify').uploadifyUpload()"/> |
---|
184 | <input type="submit" name="submit_upload" style="display:none"/> |
---|
185 | </p> |
---|
186 | {/if} |
---|
187 | </fieldset> |
---|
188 | </form> |
---|
189 | {/if} |
---|