Changeset 11975 for trunk/admin
- Timestamp:
- Aug 19, 2011, 6:04:43 PM (13 years ago)
- Location:
- trunk/admin
- Files:
-
- 2 added
- 2 deleted
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/include/photos_add_direct_prepare.inc.php
r11966 r11975 86 86 $max_upload_width = round(sqrt($available_memory/(2 * $fudge_factor))); 87 87 $max_upload_height = round(2 * $max_upload_width / 3); 88 $max_upload_resolution = floor($max_upload_width * $max_upload_height / (1024 * 1024)); 88 89 // we don't want dimensions like 2995x1992 but 3000x2000 90 $max_upload_width = round($max_upload_width/100)*100; 91 $max_upload_height = round($max_upload_height/100)*100; 92 93 $max_upload_resolution = floor($max_upload_width * $max_upload_height / (1000000)); 89 94 90 95 // no need to display a limitation warning if the limitation is huge like 20MP -
trunk/admin/include/photos_add_direct_process.inc.php
r11962 r11975 43 43 ); 44 44 } 45 46 $category_id = $_POST['category']; 47 45 else 46 { 47 $category_id = $_POST['category']; 48 } 49 50 if (isset($_POST['onUploadError']) and is_array($_POST['onUploadError']) and count($_POST['onUploadError']) > 0) 51 { 52 foreach ($_POST['onUploadError'] as $error) 53 { 54 array_push($page['errors'], $error); 55 } 56 } 57 48 58 $image_ids = array(); 49 59 -
trunk/admin/include/uploadify/uploadify.css
r11966 r11975 1 1 /* 2 Uploadify v2.1.0 3 Release Date: August 24, 2009 4 5 Copyright (c) 2009 Ronnie Garcia, Travis Nickels 2 Uploadify v3.0.0 3 Copyright (c) 2010 Ronnie Garcia 6 4 7 5 Permission is hereby granted, free of charge, to any person obtaining a copy … … 23 21 THE SOFTWARE. 24 22 */ 23 24 .uploadify {margin:0 auto 10px auto} 25 26 .uploadifyButton { 27 display: block; 28 cursor: pointer; 29 font-size: 11px; 30 font-weight: bold; 31 color: #eeeeee; 32 padding: 8px 0; 33 text-align: center; 34 height: 14px; 35 width: 100%; 36 background-color: #464646; 37 -webkit-border-radius:5px; 38 -moz-border-radius:5px; 39 border-radius:5px; 40 letter-spacing:2px; 41 } 42 .uploadify:hover .uploadifyButton { 43 color:#fff; 44 background-color: #333; 45 cursor:pointer; 46 } 47 .uploadifyQueueItem { 48 background-color: #F5F5F5; 49 -webkit-border-radius: 3px; 50 -moz-border-radius: 3px; 51 border-radius: 3px; 52 font: 11px Verdana, Geneva, sans-serif; 53 margin-top: 5px; 54 max-width: 350px; 55 padding: 10px; 56 } 57 .uploadifyQueueItem .cancel { 58 float: right; 59 } 60 .uploadifyQueueItem .fileName, .uploadifyQueueItem .data { 61 float: left; 62 } 63 .uploadifyQueue .completed { 64 background-color: #E5E5E5; 65 } 66 .uploadifyProgress { 67 background-color: #E5E5E5; 68 margin-top: 25px; 69 height: 3px; 70 width: 100%; 71 position: relative; 72 } 73 .uploadifyProgressBar { 74 background-color: #0099FF; 75 height: 3px; 76 width: 1px; 77 position: absolute; 78 left: 0px; 79 } 80 .uploadifyError { 81 background-color: #FDE5DD !important; 82 } 83 84 85 /* Piwigo specific */ 25 86 #fileQueue { 26 87 width: 420px; … … 50 111 background-color: #333; 51 112 border: 1px solid #666; 52 margin-top: 10px;53 113 width: 100%; 54 114 } -
trunk/admin/themes/default/template/photos_add_direct.tpl
r11967 r11975 1 1 {if $upload_mode eq 'multiple'} 2 2 {combine_script id='jquery.jgrowl' load='footer' require='jquery' path='themes/default/js/plugins/jquery.jgrowl_minimized.js' } 3 {combine_script id='swfobject' load='footer' path='admin/include/uploadify/swfobject.js'} 4 {combine_script id='jquery.uploadify' load='footer' require='jquery' path='admin/include/uploadify/jquery.uploadify.v2.1.0.min.js' } 3 {combine_script id='jquery.uploadify' load='footer' require='jquery' path='admin/include/uploadify/jquery.uploadify.v3.0.0.min.js' } 5 4 {combine_css path="admin/themes/default/uploadify.jGrowl.css"} 6 5 {combine_css path="admin/include/uploadify/uploadify.css"} … … 177 176 var session_id = '{$session_id}'; 178 177 var pwg_token = '{$pwg_token}'; 179 var buttonText = 'Browse';180 var sizeLimit = {$upload_max_filesize};178 var buttonText = "{'Select files'|@translate}"; 179 var sizeLimit = Math.round({$upload_max_filesize} / 1024); /* in KBytes */ 181 180 182 181 {literal} 183 182 jQuery("#uploadify").uploadify({ 184 'uploader' : uploadify_path + '/uploadify. swf',185 ' script' : uploadify_path + '/uploadify.php',186 's criptData' : {187 'upload_id' : upload_id, 188 'session_id' : session_id,189 'pwg_token' : pwg_token,190 },191 'cancelIm g': uploadify_path + '/cancel.png',183 'uploader' : uploadify_path + '/uploadify.php', 184 'langFile' : uploadify_path + '/uploadifyLang_en.js', 185 'swf' : uploadify_path + '/uploadify.swf', 186 187 buttonCursor : 'pointer', 188 'buttonText' : buttonText, 189 'width' : 300, 190 'cancelImage' : uploadify_path + '/cancel.png', 192 191 'queueID' : 'fileQueue', 193 192 'auto' : false, 194 'buttonText' : buttonText,195 193 'multi' : true, 196 'fileDesc' : 'Photo files (*.jpg,*.jpeg,*.png)', 197 'fileExt' : '*.jpg;*.JPG;*.jpeg;*.JPEG;*.png;*.PNG', 198 'sizeLimit' : sizeLimit, 194 'fileTypeDesc' : 'Photo files', 195 'fileTypeExts' : '*.jpg;*.JPG;*.jpeg;*.JPEG;*.png;*.PNG;*.gif;*.GIF', 196 'fileSizeLimit' : sizeLimit, 197 'progressData' : 'percentage', 198 requeueErrors : false, 199 199 'onSelect' : function(event,ID,fileObj) { 200 200 jQuery("#fileQueue").show(); 201 201 }, 202 'onAllComplete' : function(event, data) { 203 if (data.errors) { 202 'onQueueComplete' : function(stats) { 203 jQuery("input[name=submit_upload]").click(); 204 }, 205 onUploadError: function (file,errorCode,errorMsg,errorString,swfuploadifyQueue) { 206 /* uploadify calls the onUploadError trigger when the user cancels a file! */ 207 /* There no error so we skip it to avoid panic. */ 208 if ("Cancelled" == errorString) { 204 209 return false; 205 210 } 206 else { 207 jQuery("input[name=submit_upload]").click(); 208 } 209 }, 210 onError: function (event, queueID ,fileObj, errorObj) { 211 var msg; 212 213 if (errorObj.type === "HTTP") { 214 if (errorObj.info === 404) { 215 alert('Could not find upload script.'); 216 msg = 'Could not find upload script.'; 217 } 218 else { 219 msg = errorObj.type+": "+errorObj.info; 220 } 221 } 222 else if (errorObj.type ==="File Size") { 223 msg = "File too big"; 224 msg = msg + '<br>'+fileObj.name+': '+humanReadableFileSize(fileObj.size); 225 msg = msg + '<br>Limit: '+humanReadableFileSize(sizeLimit); 226 } 227 else { 228 msg = errorObj.type+": "+errorObj.info; 229 } 211 212 var msg = file.name+', '+errorString; 213 214 /* Let's put the error message in the form to display once the form is */ 215 /* performed, it makes support easier when user can copy/paste the error */ 216 /* thrown. */ 217 jQuery("#uploadForm").append('<input type="hidden" name="onUploadError[]" value="'+msg+'">'); 230 218 231 219 jQuery.jGrowl( 232 '<p></p> '+msg,220 '<p></p>onUploadError '+msg, 233 221 { 234 222 theme: 'error', 235 223 header: 'ERROR', 236 sticky: true237 }238 );239 240 jQuery("#fileUploadgrowl" + queueID).fadeOut(241 250,242 function() {243 jQuery("#fileUploadgrowl" + queueID).remove()244 }245 );246 return false;247 },248 onCancel: function (a, b, c, d) {249 var msg = "Cancelled uploading: "+c.name;250 jQuery.jGrowl(251 '<p></p>'+msg,252 {253 theme: 'warning',254 header: 'Cancelled Upload',255 224 life: 4000, 256 225 sticky: false 257 226 } 258 227 ); 228 229 return false; 259 230 }, 260 onClearQueue: function (a, b) { 261 var msg = "Cleared "+b.fileCount+" files from queue"; 262 jQuery.jGrowl( 263 '<p></p>'+msg, 264 { 265 theme: 'warning', 266 header: 'Cleared Queue', 267 life: 4000, 268 sticky: false 269 } 270 ); 271 }, 272 onComplete: function (a, b ,c, response, e) { 273 var size = Math.round(c.size/1024); 274 275 var response = jQuery.parseJSON(response); 276 231 onUploadSuccess: function (file,data,response) { 232 var data = jQuery.parseJSON(data); 277 233 jQuery("#uploadedPhotos").parent("fieldset").show(); 278 jQuery("#uploadedPhotos").prepend('<img src="'+response.thumbnail_url+'" class="thumbnail"> '); 279 280 jQuery.jGrowl( 281 '<p></p>'+c.name+' - '+size+'KB', 282 { 283 theme: 'success', 284 header: 'Upload Complete', 285 life: 4000, 286 sticky: false 287 } 288 ); 234 235 /* Let's display the thumbnail of the uploaded photo, no need to wait the */ 236 /* end of the queue */ 237 jQuery("#uploadedPhotos").prepend('<img src="'+data.thumbnail_url+'" class="thumbnail"> '); 289 238 } 290 239 }); … … 296 245 297 246 jQuery("#uploadify").uploadifySettings( 298 ' scriptData',247 'postData', 299 248 { 300 249 'category_id' : jQuery("select[name=category] option:selected").val(), 301 250 'level' : jQuery("select[name=level] option:selected").val(), 251 'upload_id' : upload_id, 252 'session_id' : session_id, 253 'pwg_token' : pwg_token, 302 254 } 303 255 ); … … 413 365 414 366 {elseif $upload_mode eq 'multiple'} 415 416 <p> 417 <input type="file" name="uploadify" id="uploadify"> 418 </p> 367 <div id="uploadify">You've got a problem with your JavaScript</div> 419 368 420 369 <div id="fileQueue" style="display:none"></div>
Note: See TracChangeset
for help on using the changeset viewer.