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