Changeset 26387
- Timestamp:
- Jan 1, 2014, 11:34:30 AM (10 years ago)
- Location:
- extensions/url_uploader
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/url_uploader/admin.php
r20407 r26387 22 22 $tabsheet->select('url_uploader'); 23 23 $tabsheet->assign(); 24 25 $page['active_menu'] = get_active_menu('photo'); 24 26 25 27 … … 110 112 if (isset($_POST['onUploadError']) and is_array($_POST['onUploadError']) and count($_POST['onUploadError']) > 0) 111 113 { 112 array_push($page['errors'], sprintf(l10n('%d photos not imported'), count($_POST['onUploadError'])));114 $page['errors'][] = l10n('%d photos not imported', count($_POST['onUploadError'])); 113 115 foreach ($_POST['onUploadError'] as $error) 114 116 { 115 array_push($page['errors'], $error);117 $page['errors'][] = $error; 116 118 } 117 119 } … … 140 142 ); 141 143 142 array_push($page['thumbnails'], $thumbnail);144 $page['thumbnails'][] = $thumbnail; 143 145 } 144 146 … … 146 148 { 147 149 // nb uploaded 148 array_push($page['infos'], sprintf( 149 l10n('%d photos uploaded'), 150 count($page['thumbnails']) 151 )); 150 $page['infos'][] = l10n('%d photos uploaded', count($page['thumbnails'])); 152 151 153 152 // level 154 153 if (0 != $_POST['level']) 155 154 { 156 array_push($page['infos'], sprintf( 157 l10n('Privacy level set to "%s"'), 158 l10n(sprintf('Level %d', $_POST['level'])) 159 )); 155 $page['infos'][] = l10n('Privacy level set to "%s"', l10n(sprintf('Level %d', $_POST['level']))); 160 156 } 161 157 … … 169 165 $category_name = get_cat_display_name_from_id($category_id, 'admin.php?page=album-'); 170 166 171 array_push($page['infos'], sprintf( 172 l10n('Album "%s" now contains %d photos'), 173 '<em>'.$category_name.'</em>', 174 $count 175 )); 167 $page['infos'][] = l10n('Album "%s" now contains %d photos', '<em>'.$category_name.'</em>', $count); 176 168 177 169 $page['batch_link'] = PHOTOS_ADD_BASE_URL.'&batch='.implode(',', $image_ids); … … 189 181 $upload_mode = isset($conf['url_uploader_mode']) ? $conf['url_uploader_mode'] : 'single'; 190 182 191 if ( isset($_GET['upload_mode']) and $_GET['upload_mode']!=$upload_mode and in_array($_GET['upload_mode'], $upload_modes))183 if (isset($_GET['upload_mode']) and $_GET['upload_mode']!=$upload_mode and in_array($_GET['upload_mode'], $upload_modes)) 192 184 { 193 185 $upload_mode = $_GET['upload_mode']; … … 218 210 // send page content 219 211 $template->assign_var_from_handle('ADMIN_CONTENT', 'urluploader_content'); 220 221 ?> -
extensions/url_uploader/include/functions.inc.php
r20064 r26387 13 13 array_slice($sheets, 0, 1) + 14 14 array('url_uploader' => array( 15 'caption' => l10n('URL Uploader'),15 'caption' => '<span class="icon-link"></span>' . l10n('URL Uploader'), 16 16 'url' => URLUPLOADER_ADMIN, 17 17 )) + … … 51 51 return $default; 52 52 } 53 54 ?> -
extensions/url_uploader/include/ws_functions.inc.php
r20407 r26387 20 20 'url_in_comment' => array('default' => true), 21 21 ), 22 'Add image from remote URL.' 22 'Add image from remote URL.', 23 null, 24 array('admin_only'=>true) 23 25 ); 24 26 } … … 33 35 } 34 36 37 load_language('plugin.lang', URLUPLOADER_PATH); 38 35 39 $params = array_map('trim', $params); 36 40 … … 41 45 if (empty($params['file_url'])) 42 46 { 43 return new PwgError(WS_ERR_INVALID_PARAM, 'File URL is empty');47 return new PwgError(WS_ERR_INVALID_PARAM, l10n('File URL is empty')); 44 48 } 45 49 // check remote url 46 50 if (!url_is_remote($params['file_url'])) 47 51 { 48 return new PwgError(WS_ERR_INVALID_PARAM, 'Invalid file URL');52 return new PwgError(WS_ERR_INVALID_PARAM, l10n('Invalid file URL')); 49 53 } 50 54 // check file extension 51 55 if (!in_array(strtolower(get_extension($params['file_url'])), $allowed_extensions)) 52 56 { 53 return new PwgError(WS_ERR_INVALID_PARAM, 'Invalid file type');57 return new PwgError(WS_ERR_INVALID_PARAM, l10n('Invalid file type')); 54 58 } 55 59 … … 66 70 { 67 71 @unlink($temp_filename); 68 return new PwgError(WS_ERR_INVALID_PARAM, 'Unable to download file');72 return new PwgError(WS_ERR_INVALID_PARAM, l10n('Unable to download file')); 69 73 } 70 74 // check mime-type … … 72 76 { 73 77 @unlink($temp_filename); 74 return new PwgError(WS_ERR_INVALID_PARAM, 'Invalid file type');78 return new PwgError(WS_ERR_INVALID_PARAM, l10n('Invalid file type')); 75 79 } 76 80 … … 131 135 ); 132 136 } 133 134 ?> -
extensions/url_uploader/main.inc.php
r20064 r26387 12 12 13 13 14 // +-----------------------------------------------------------------------+ 15 // | Define plugin constants | 16 // +-----------------------------------------------------------------------+ 17 defined('URLUPLOADER_ID') or define('URLUPLOADER_ID', basename(dirname(__FILE__))); 14 define('URLUPLOADER_ID', basename(dirname(__FILE__))); 18 15 define('URLUPLOADER_PATH' , PHPWG_PLUGINS_PATH . URLUPLOADER_ID . '/'); 19 16 define('URLUPLOADER_ADMIN', get_root_url() . 'admin.php?page=plugin-' . URLUPLOADER_ID); 20 17 21 18 22 // +-----------------------------------------------------------------------+23 // | Add event handlers |24 // +-----------------------------------------------------------------------+25 19 if (defined('IN_ADMIN')) 26 20 { 27 // new tab on photo page28 21 add_event_handler('tabsheet_before_select', 'urluploader_tabsheet_before_select', EVENT_HANDLER_PRIORITY_NEUTRAL, 2); 29 22 } 30 23 31 // add API function32 24 add_event_handler('ws_add_methods', 'urluploader_ws_add_methods'); 25 33 26 34 27 include_once(URLUPLOADER_PATH . 'include/functions.inc.php'); 35 28 include_once(URLUPLOADER_PATH . 'include/ws_functions.inc.php'); 36 37 ?> -
extensions/url_uploader/maintain.inc.php
r19804 r26387 4 4 function plugin_uninstall() 5 5 { 6 pwg_query('DELETE FROM `'. CONFIG_TABLE .'` WHERE param = "url_uploader_mode" LIMIT 1;');6 conf_delete_param('url_uploader_mode'); 7 7 } 8 9 ?> -
extensions/url_uploader/template/photos_add.tpl
r20407 r26387 1 {combine_css path=$URLUPLOADER_PATH| @cat:"template/style.css"}2 {combine_script id= "URI" load="footer" path=$URLUPLOADER_PATH|@cat:"template/URI.min.js"}3 {combine_css path=$URLUPLOADER_PATH| @cat:"template/jquery.textarea-lines-numbers.css"}4 {combine_script id= "createTextareaWithLines" load="footer" require="jquery.ui.resizable" path=$URLUPLOADER_PATH|@cat:"template/jquery.textarea-lines-numbers.js"}1 {combine_css path=$URLUPLOADER_PATH|cat:'template/style.css'} 2 {combine_script id='URI' load='footer' path=$URLUPLOADER_PATH|cat:'template/URI.min.js'} 3 {combine_css path=$URLUPLOADER_PATH|cat:'template/jquery.textarea-lines-numbers.css'} 4 {combine_script id='createTextareaWithLines' load='footer' require='jquery.ui.resizable' path=$URLUPLOADER_PATH|cat:'template/jquery.textarea-lines-numbers.js'} 5 5 6 6 {if $upload_mode == 'multiple'} … … 8 8 {combine_script id='jquery.jgrowl' load='footer' require='jquery' path='themes/default/js/plugins/jquery.jgrowl_minimized.js' } 9 9 {combine_script id='jquery.ui.progressbar' load='footer'} 10 {combine_css path= "admin/themes/default/uploadify.jGrowl.css"}10 {combine_css path='themes/default/js/plugins/jquery.jgrowl.css'} 11 11 {/if} 12 12 … … 16 16 17 17 {footer_script} 18 var allowed_extensions = new Array('jpeg','jpg','png','gif'); 19 var errorHead = '{'ERROR'|@translate|@escape:'javascript'}'; 20 var errorMsg = '{'an error happened'|@translate|@escape:'javascript'}'; 21 22 var lang = new Array(); 23 lang['Invalid file URL'] = '{'Invalid file URL'|@translate|@escape:'javascript'}'; 24 lang['Invalid file type'] = '{'Invalid file type'|@translate|@escape:'javascript'}'; 25 lang['File URL is empty'] = '{'File URL is empty'|@translate|@escape:'javascript'}'; 26 lang['Unable to download file'] = '{'Unable to download file'|@translate|@escape:'javascript'}'; 27 lang['Pending'] = '{'Pending'|@translate|@escape:'javascript'}'; 28 lang['Delete this item'] = '{'Delete this item'|@translate|@escape:'javascript'}'; 29 30 {literal} 31 jQuery("#hideErrors").click(function() { 32 jQuery("#formErrors").hide(); 18 (function($){ 19 var allowed_extensions = new Array('jpeg','jpg','png','gif'); 20 21 $('#hideErrors').click(function() { 22 $('#formErrors').hide(); 33 23 return false; 34 24 }); 35 25 36 jQuery("#uploadWarningsSummary a.showInfo").click(function() {37 jQuery("#uploadWarningsSummary").hide();38 jQuery("#uploadWarnings").show();26 $('#uploadWarningsSummary a.showInfo').click(function() { 27 $('#uploadWarningsSummary').hide(); 28 $('#uploadWarnings').show(); 39 29 return false; 40 30 }); 41 31 42 jQuery("#showPermissions").click(function() {43 jQuery(this).parent(".showFieldset").hide();44 jQuery("#permissions").show();32 $('#showPermissions').click(function() { 33 $(this).parent('.showFieldset').hide(); 34 $('#permissions').show(); 45 35 return false; 46 36 }); 47 {/literal} 48 49 50 {* <!-- MULTIPLE UPLOAD --> *} 51 {if $upload_mode == 'multiple'} 52 {literal} 53 function checkUploadStart() { 54 var nbErrors = 0; 55 56 jQuery("#formErrors").hide(); 57 jQuery("#formErrors li").hide(); 58 59 if (jQuery("#albumSelect option:selected").length == 0) { 60 jQuery("#formErrors #noAlbum").show(); 61 nbErrors++; 37 38 {* <!-- MULTIPLE UPLOAD --> *} 39 {if $upload_mode == 'multiple'} 40 function checkUploadStart() { 41 var nbErrors = 0; 42 43 $('#formErrors').hide(); 44 $('#formErrors li').hide(); 45 46 if ($('#albumSelect option:selected').length == 0) { 47 $('#formErrors #noAlbum').show(); 48 nbErrors++; 49 } 50 51 var nbFiles = $('table#links tr.pending').length; 52 53 if (nbFiles == 0) { 54 $('#formErrors #noPhoto').show(); 55 nbErrors++; 56 } 57 58 if (nbErrors != 0) { 59 $('#formErrors').show(); 60 return false; 61 } 62 else { 63 return true; 64 } 62 65 } 63 64 var nbFiles = jQuery("table#links tr.pending").length; 65 66 if (nbFiles == 0) { 67 jQuery("#formErrors #noPhoto").show(); 68 nbErrors++; 66 67 function trim (str) { 68 return str.replace(/^\s+/g,'').replace(/\s+$/g,'') 69 69 } 70 70 71 if (nbErrors != 0) { 72 jQuery("#formErrors").show(); 71 $('input[name=add_links]').click(function() { 72 $input = $('textarea#urls'); 73 74 if ($input.val() != '') { 75 $('table#links').show(); 76 77 var lines = $input.val().split('\n'); 78 var html = ''; 79 $input.val(''); 80 81 for (i in lines) { 82 line = lines[i].split('|'); 83 item = {}; 84 85 // no name given 86 if (line.length == 1) { 87 uri = new URI(trim(line[0])); 88 item.name = ''; 89 } 90 // name given 91 else { 92 uri = new URI(trim(line[1])); 93 item.name = trim(line[0]); 94 } 95 96 uri.fragment(''); 97 item.url = uri.href(); 98 item.short_url = item.url; 99 100 // shortened url for display 101 if (item.url.length > 40) { 102 item.short_url = item.url.substring(0, 15) + ' ... ' + item.url.substring(item.url.length-15); 103 } 104 105 // check if consistent url 106 if (uri.is('relative')) { 107 item.status = 'error'; 108 item.info = '{'Invalid file URL'|translate|escape:javascript}'; 109 } 110 else { 111 // check if good extension 112 if (allowed_extensions.indexOf(uri.suffix().toLowerCase()) == -1) { 113 item.status = 'error'; 114 item.info = '{'Invalid file type'|translate|escape:javascript}'; 115 } 116 else { 117 item.status = 'pending'; 118 item.info = '{'Pending'|translate|escape:javascript}'; 119 } 120 } 121 122 // add link to table 123 html+= '<tr class="'+ item.status + '" data-name="'+ item.name +'" data-url="'+ item.url +'">'+ 124 '<td>'+ item.name +'</td>'+ 125 '<td><a href="'+ item.url +'">'+ item.short_url +'</a></td>'+ 126 '<td>'+ item.info +'</td>'+ 127 '<td><a class="delete" title="{'Delete this item'|translate|escape:javascript}"> </a></td>'+ 128 '</tr>'; 129 } 130 131 $('table#links tbody').append(html); 132 } 133 134 $input.focus(); 73 135 return false; 136 }); 137 138 $('table#links').on('click', 'a.delete', function() { 139 $(this).parents('tr').remove(); 140 $('textarea#urls').focus(); 141 }); 142 143 // AJAX MANAGER 144 var import_done = 0; 145 var import_selected = 0; 146 var queuedManager = $.manageAjax.create('queued', { 147 queue: true, 148 maxRequests: 1 149 }); 150 151 function performImport(file_url, category, name, level, url_in_comment, $target) { 152 queuedManager.add({ 153 type: 'GET', 154 dataType: 'json', 155 url: 'ws.php', 156 data: { 157 method: 'pwg.images.addRemote', 158 file_url: file_url, 159 category: category, 160 name: name, 161 level: level, 162 url_in_comment: url_in_comment, 163 format: 'json' 164 }, 165 success: function(data) { 166 if (data['stat'] == 'ok') { 167 $target.remove(); 168 $('#uploadedPhotos').parent('fieldset').show(); 169 $('#uploadedPhotos').prepend('<img src="'+ data['result']['thumbnail_url'] +'" class="thumbnail"> '); 170 $('#uploadForm').append('<input type="hidden" name="imageIds[]" value="'+ data['result']['image_id'] +'">'); 171 } 172 else { 173 $.jGrowl(name +' : '+ data['message'], { 174 theme: 'error', sticky: true, 175 header: '{'ERROR'|translate}' 176 }); 177 178 $target.children('td:nth-child(3)').html(lang[data['message']]); 179 $('#uploadForm').append('<input type="hidden" name="onUploadError[]" value="'+ file_url +' : '+ data['message'] +'">'); 180 } 181 182 import_done++; 183 $('#progressbar').progressbar({ value: import_done }); 184 $('#progressCurrent').text(import_done); 185 186 if (import_done == import_selected) { 187 $('#uploadForm').submit(); 188 } 189 }, 190 error: function(data) { 191 $.jGrowl(name +' : '+ '{'an error happened'|translate|escape:javascript}', { 192 theme: 'error', sticky: true, 193 header: '{'ERROR'|translate}' 194 }); 195 196 $target.children('td:nth-child(3)').html('{'an error happened'|translate|escape:javascript}'); 197 } 198 }); 74 199 } 75 else { 76 return true; 77 } 78 } 79 80 function trim (myString) { 81 return myString.replace(/^\s+/g,'').replace(/\s+$/g,'') 82 } 83 84 jQuery("input[name='add_links']").click(function() { 85 $input = jQuery("textarea#urls"); 86 87 if ($input.val() != "") { 88 jQuery("table#links").show(); 89 90 lines = $input.val().split('\n'); 91 $input.val(""); 92 93 for (i in lines) { 94 line = lines[i].split('|'); 95 item = new Array; 96 97 // no name given 98 if (line.length == 1) { 99 uri = new URI(trim(line[0])); 100 item['name'] = ""; 101 } 102 // name given 103 else { 104 uri = new URI(trim(line[1])); 105 item['name']= trim(line[0]); 106 } 107 108 uri.fragment(""); 109 item['url'] = uri.href(); 110 item['short_url'] = item['url']; 111 112 // shortened url for display 113 if (item['url'].length > 40) { 114 item['short_url'] = item['url'].substring(0, 17) + ' ... ' + item['url'].substring(item['url'].length-17); 115 } 116 117 // check if consistent url 118 if (uri.is("relative")) { 119 item['status'] = 'error'; 120 item['info'] = lang['Invalid file URL']; 121 } 122 else { 123 // check if good extension 124 if (allowed_extensions.indexOf(uri.suffix().toLowerCase()) == -1) { 125 item['status'] = 'error'; 126 item['info'] = lang['Invalid file type']; 127 } 128 else { 129 item['status'] = 'pending'; 130 item['info'] = lang['Pending']; 131 } 132 } 133 134 // add link to table 135 jQuery("table#links tbody").append('<tr class="'+ item['status'] + '" data-name="'+ item['name'] +'" data-url="'+ item['url'] +'">'+ 136 '<td>'+ item['name'] +'</td>'+ 137 '<td><a href="'+ item['url'] +'">'+ item['short_url'] +'</a></td>'+ 138 '<td>'+ item['info'] +'</td>'+ 139 '<td><a class="delete" title="'+ lang['Delete this item'] +'"> </a></td>'+ 140 '</tr>'); 141 } 142 } 143 144 $input.focus(); 145 return false; 146 }); 147 148 jQuery("table#links").on("click", "a.delete", function() { 149 $(this).parents("tr").remove(); 150 jQuery("textarea#urls").focus(); 151 }); 152 153 /* <!-- AJAX MANAGER --> */ 154 var import_done = 0; 155 var import_selected = 0; 156 var queuedManager = jQuery.manageAjax.create('queued', { 157 queue: true, 158 maxRequests: 1 159 }); 160 161 function performImport(file_url, category, name, level, url_in_comment, $target) { 162 queuedManager.add({ 163 type: 'GET', 164 dataType: 'json', 165 url: 'ws.php', 166 data: { method: 'pwg.images.addRemote', file_url: file_url, category: category, name: name, level: level, url_in_comment: url_in_comment, format: 'json' }, 167 success: function(data) { 168 if (data['stat'] == 'ok') { 169 $target.remove(); 170 jQuery("#uploadedPhotos").parent("fieldset").show(); 171 jQuery("#uploadedPhotos").prepend('<img src="'+ data['result']['thumbnail_url'] +'" class="thumbnail"> '); 172 jQuery("#uploadForm").append('<input type="hidden" name="imageIds[]" value="'+ data['result']['image_id'] +'">'); 173 } 174 else { 175 jQuery.jGrowl(name +' : '+ lang[data['message']], { 176 theme: 'error', 177 header: errorHead, 178 sticky: true 179 }); 180 181 $target.children("td:nth-child(3)").html(lang[data['message']]); 182 jQuery("#uploadForm").append('<input type="hidden" name="onUploadError[]" value="'+ file_url +' : '+ lang[data['message']] +'">'); 183 } 184 185 import_done++; 186 jQuery("#progressbar").progressbar({value: import_done}); 187 jQuery("#progressCurrent").text(import_done); 188 189 if (import_done == import_selected) { 190 $("#uploadForm").submit(); 191 } 192 }, 193 error: function(data) { 194 jQuery.jGrowl(name +' : '+ errorMsg, { 195 theme: 'error', 196 header: errorHead, 197 sticky: true 198 }); 199 200 $target.children("td:nth-child(3)").html(errorMsg); 201 } 202 }); 203 } 204 205 jQuery("input[name='submit_upload']").click(function() { 206 if (!checkUploadStart()) { 200 201 $('input[name=submit_upload]').click(function() { 202 if (!checkUploadStart()) { 203 return false; 204 } 205 206 import_selected = $('table#links tr.pending').length; 207 208 $('table#links a.delete').hide(); 209 210 $('#progressbar').progressbar({ max: import_selected, value:0 }); 211 $('#progressMax').text(import_selected); 212 $('#progressCurrent').text(0); 213 $('#uploadProgress').show(); 214 215 $('table#links tr.pending').each(function() { 216 performImport( 217 $(this).data('url'), 218 $('select[name=category] option:selected').val(), 219 $(this).data('name'), 220 $('select[name=level] option:selected').val(), 221 $('input[name=url_in_comment]').is(':checked'), 222 $(this) 223 ); 224 }); 225 207 226 return false; 208 } 209 210 import_selected = jQuery("table#links tr.pending").length; 211 212 jQuery("table#links a.delete").hide(); 213 214 jQuery("#progressbar").progressbar({max: import_selected, value:0}); 215 jQuery("#progressMax").text(import_selected); 216 jQuery("#progressCurrent").text(0); 217 jQuery("#uploadProgress").show(); 218 219 jQuery("table#links tr.pending").each(function() { 220 performImport( 221 $(this).data('url'), 222 $("select[name=category] option:selected").val(), 223 $(this).data('name'), 224 $("select[name=level] option:selected").val(), 225 $("input[name=url_in_comment]").is(":checked"), 226 $(this) 227 ); 228 }); 229 230 return false; 231 }); 232 233 $("textarea#urls").textareaLinesNumbers({ 234 lines:999, 235 trailing:'.' 236 }); 237 {/literal} 227 }); 228 229 $('textarea#urls').textareaLinesNumbers({ 230 lines:999, 231 trailing:'.' 232 }); 238 233 239 234 240 235 {* <!-- SINGLE UPLOAD --> *} 241 236 {else} 242 {literal} 243 function checkUploadStart() { 244 var nbErrors = 0; 245 246 jQuery("#formErrors").hide(); 247 jQuery("#formErrors li").hide(); 248 249 if (jQuery("#albumSelect option:selected").length == 0) { 250 jQuery("#formErrors #noAlbum").show(); 251 nbErrors++; 237 function checkUploadStart() { 238 var nbErrors = 0; 239 240 $('#formErrors').hide(); 241 $('#formErrors li').hide(); 242 243 if ($('#albumSelect option:selected').length == 0) { 244 $('#formErrors #noAlbum').show(); 245 nbErrors++; 246 } 247 248 if ($('input[name=file_url]').val() == '') { 249 $('#formErrors #urlEmpty').show(); 250 nbErrors++; 251 } 252 else { 253 uri = new URI($('input[name=file_url]').val()); 254 if (uri.is('relative')) { 255 $('#formErrors #urlError').show(); 256 nbErrors++; 257 } 258 else if (allowed_extensions.indexOf(uri.suffix().toLowerCase()) == -1) { 259 $('#formErrors #typeError').show(); 260 nbErrors++; 261 } 262 } 263 264 if (nbErrors != 0) { 265 $('#formErrors').show(); 266 return false; 267 } 268 else { 269 return true; 270 } 252 271 } 253 254 if (jQuery("input[name='file_url']").val() == "") { 255 jQuery("#formErrors #urlEmpty").show(); 256 nbErrors++; 257 } 258 else { 259 uri = new URI(jQuery("input[name='file_url']").val()); 260 if (uri.is('relative')) { 261 jQuery("#formErrors #urlError").show(); 262 nbErrors++; 263 } 264 else if (allowed_extensions.indexOf(uri.suffix().toLowerCase()) == -1) { 265 jQuery("#formErrors #typeError").show(); 266 nbErrors++; 267 } 268 } 269 270 if (nbErrors != 0) { 271 jQuery("#formErrors").show(); 272 return false; 273 } 274 else { 275 return true; 276 } 277 } 278 279 jQuery("input[name='submit_upload']").click(function() { 280 return checkUploadStart(); 281 }); 282 {/literal} 272 273 $('input[name=submit_upload]').click(function() { 274 return checkUploadStart(); 275 }); 283 276 {/if} 284 277 278 }(jQuery)); 285 279 {/footer_script} 286 280 287 281 288 {html_head}{literal} 289 <style type="text/css"> 282 {html_style} 290 283 a.delete { 291 284 background:url('admin/include/uploadify/cancel.png'); 292 285 } 293 </style> 294 {/literal}{/html_head} 286 {/html_style} 295 287 296 288 297 289 <div class="titrePage"> 298 <h2>{'Upload Photos'| @translate} {$TABSHEET_TITLE}</h2>290 <h2>{'Upload Photos'|translate} {$TABSHEET_TITLE}</h2> 299 291 </div> 300 292 … … 302 294 303 295 {if count($setup_errors) > 0} 304 <div class="errors">305 <ul>306 {foreach from=$setup_errors item=error}307 <li>{$error}</li>308 {/foreach}309 </ul>310 </div>296 <div class="errors"> 297 <ul> 298 {foreach from=$setup_errors item=error} 299 <li>{$error}</li> 300 {/foreach} 301 </ul> 302 </div> 311 303 {else} 312 304 313 314 <div class="warnings">315 <ul>316 {foreach from=$setup_warnings item=warning}317 <li>{$warning}</li>318 {/foreach}319 </ul>320 <div class="hideButton" style="text-align:center"><a href="{$hide_warnings_link}">{'Hide'|@translate}</a></div>321 </div>322 305 {if count($setup_warnings) > 0} 306 <div class="warnings"> 307 <ul> 308 {foreach from=$setup_warnings item=warning} 309 <li>{$warning}</li> 310 {/foreach} 311 </ul> 312 <div class="hideButton" style="text-align:center"><a href="{$hide_warnings_link}">{'Hide'|translate}</a></div> 313 </div> 314 {/if} 323 315 324 316 {if !empty($thumbnails)} 325 <fieldset> 326 <legend>{'Uploaded Photos'|@translate}</legend> 327 <div> 328 {foreach from=$thumbnails item=thumbnail} 329 <a href="{$thumbnail.link}" class="externalLink"> 330 <img src="{$thumbnail.src}" alt="{$thumbnail.file}" title="{$thumbnail.title}" class="thumbnail"> 331 </a> 332 {/foreach} 317 <fieldset> 318 <legend>{'Uploaded Photos'|translate}</legend> 319 <div> 320 {foreach from=$thumbnails item=thumbnail} 321 <a href="{$thumbnail.link}" class="externalLink"> 322 <img src="{$thumbnail.src}" alt="{$thumbnail.file}" title="{$thumbnail.title}" class="thumbnail"> 323 </a> 324 {/foreach} 325 </div> 326 327 <p id="batchLink"><a href="{$batch_link}">{$batch_label}</a></p> 328 </fieldset> 329 330 <p style="margin:10px"><a href="{$another_upload_link}">{'Add another set of photos'|translate}</a></p> 331 332 {else} 333 <div id="formErrors" class="errors" style="display:none"> 334 <ul> 335 <li id="noAlbum">{'Select an album'|translate}</li> 336 <li id="noPhoto">{'Select at least one photo'|translate}</li> 337 <li id="urlEmpty">{'File URL is empty'|translate}</li> 338 <li id="urlError">{'Invalid file URL'|translate}</li> 339 <li id="typeError">{'Invalid file type'|translate}</li> 340 </ul> 341 <div class="hideButton" style="text-align:center"><a href="#" id="hideErrors">{'Hide'|translate}</a></div> 333 342 </div> 334 <p id="batchLink"><a href="{$batch_link}">{$batch_label}</a></p> 335 </fieldset> 336 <p style="margin:10px"><a href="{$another_upload_link}">{'Add another set of photos'|@translate}</a></p> 337 {else} 338 339 <div id="formErrors" class="errors" style="display:none"> 340 <ul> 341 <li id="noAlbum">{'Select an album'|@translate}</li> 342 <li id="noPhoto">{'Select at least one photo'|@translate}</li> 343 <li id="urlEmpty">{'File URL is empty'|@translate}</li> 344 <li id="urlError">{'Invalid file URL'|@translate}</li> 345 <li id="typeError">{'Invalid file type'|@translate}</li> 346 </ul> 347 <div class="hideButton" style="text-align:center"><a href="#" id="hideErrors">{'Hide'|@translate}</a></div> 348 </div> 349 350 <form id="uploadForm" enctype="multipart/form-data" method="post" action="{$form_action}" class="properties"> 343 344 <form id="uploadForm" enctype="multipart/form-data" method="post" action="{$form_action}" class="properties"> 351 345 <fieldset> 352 <legend>{'Drop into album'| @translate}</legend>346 <legend>{'Drop into album'|translate}</legend> 353 347 354 348 <span id="albumSelection"{if count($category_options) == 0} style="display:none"{/if}> … … 356 350 {html_options options=$category_options selected=$category_options_selected} 357 351 </select> 358 <br>{'... or '| @translate}</span><a href="#" class="addAlbumOpen" title="{'create a new album'|@translate}">{'create a new album'|@translate}</a>352 <br>{'... or '|translate}</span><a href="#" class="addAlbumOpen" title="{'create a new album'|translate}">{'create a new album'|translate}</a> 359 353 360 354 </fieldset> 361 355 362 356 <fieldset> 363 <legend>{'Select files'| @translate}</legend>357 <legend>{'Select files'|translate}</legend> 364 358 365 359 <p id="uploadWarningsSummary"> 366 {'Allowed file types: %s.'| @translate|@sprintf:$upload_file_types}360 {'Allowed file types: %s.'|translate:$upload_file_types} 367 361 {if isset($max_upload_resolution)} 368 362 {$max_upload_resolution}Mpx 369 <a class="showInfo" title="{'Learn more'| @translate}">i</a>363 <a class="showInfo" title="{'Learn more'|translate}">i</a> 370 364 {/if} 371 365 </p> 372 366 373 367 <p id="uploadWarnings"> 374 {'Allowed file types: %s.'| @translate|@sprintf:$upload_file_types}368 {'Allowed file types: %s.'|translate:$upload_file_types} 375 369 {if isset($max_upload_resolution)} 376 {'Approximate maximum resolution: %dM pixels (that\'s %dx%d pixels).'| @translate|@sprintf:$max_upload_resolution:$max_upload_width:$max_upload_height}370 {'Approximate maximum resolution: %dM pixels (that\'s %dx%d pixels).'|translate:$max_upload_resolution:$max_upload_width:$max_upload_height} 377 371 {/if} 378 372 </p> 379 373 380 374 {* <!-- SINGLE UPLOAD --> *} 381 {if $upload_mode == 'single'}375 {if $upload_mode == 'single'} 382 376 <ul> 383 377 <li> 384 378 <label> 385 <span class="property">{'File URL'| @translate}</span>379 <span class="property">{'File URL'|translate}</span> 386 380 <input type="text" name="file_url" size="70"> 387 381 </label> … … 389 383 <li> 390 384 <label> 391 <span class="property">{'Photo name'| @translate}</span>385 <span class="property">{'Photo name'|translate}</span> 392 386 <input type="text" name="photo_name" size="40"> 393 387 </label> … … 396 390 <label> 397 391 <span class="property"><input type="checkbox" name="url_in_comment" checked="checked"></span> 398 {'Add website URL in photo description'| @translate}392 {'Add website URL in photo description'|translate} 399 393 </label> 400 394 </li> 401 395 </ul> 402 396 403 <p id="uploadModeInfos">{'Want to upload many files? Try the <a href="%s">multiple uploader</a> instead.'| @translate|@sprintf:$switch_url}</p>397 <p id="uploadModeInfos">{'Want to upload many files? Try the <a href="%s">multiple uploader</a> instead.'|translate:$switch_url}</p> 404 398 405 399 {* <!-- MULTIPLE UPLOAD --> *} 406 {else} 407 400 {else} 408 401 <table id="links" class="table2" style="display:none;"> 409 402 <thead> 410 403 <tr class="throw"> 411 <th style="width:150px;">{'Photo name'| @translate}</th>412 <th>{'File URL'| @translate}</th>413 <th style="width:150px;">{'Status'| @translate}</th>404 <th style="width:150px;">{'Photo name'|translate}</th> 405 <th>{'File URL'|translate}</th> 406 <th style="width:150px;">{'Status'|translate}</th> 414 407 <th style="width:20px;"></th> 415 408 </tr> … … 417 410 <tbody> 418 411 </tbody> 419 <tfoot>420 <tr><th colspan="4">421 <label>422 <input type="checkbox" name="url_in_comment" checked="checked">423 {'Add website URL in photo description'|@translate}424 </label>425 </th></tr>426 </tfoot>427 412 </table> 428 413 429 414 <p> 430 {'One link by line, separate photo name and url with a « | ». Photo name is optional.'| @translate}415 {'One link by line, separate photo name and url with a « | ». Photo name is optional.'|translate} 431 416 <br> 432 417 <textarea id="urls"></textarea> 433 418 </p> 434 <input type="submit" name="add_links" value="{'Add links'|@translate}"> 435 436 <p id="uploadModeInfos">{'Multiple uploader doesn\'t work? Try the <a href="%s">single uploader</a> instead.'|@translate|@sprintf:$switch_url}</p> 437 {/if} 419 420 <p> 421 <label> 422 <input type="checkbox" name="url_in_comment" checked="checked"> 423 {'Add website URL in photo description'|translate} 424 </label> 425 </p> 426 427 <input type="submit" name="add_links" value="{'Add links'|translate}"> 428 429 <p id="uploadModeInfos">{'Multiple uploader doesn\'t work? Try the <a href="%s">single uploader</a> instead.'|translate:$switch_url}</p> 430 {/if} 438 431 </fieldset> 439 432 440 <p class="showFieldset"><a id="showPermissions" href="#">{'Manage Permissions'| @translate}</a></p>433 <p class="showFieldset"><a id="showPermissions" href="#">{'Manage Permissions'|translate}</a></p> 441 434 442 435 <fieldset id="permissions" style="display:none"> 443 <legend>{'Who can see these photos?'| @translate}</legend>436 <legend>{'Who can see these photos?'|translate}</legend> 444 437 445 438 <select name="level" size="1"> … … 449 442 450 443 <p> 451 <input class="submit" type="submit" name="submit_upload" value="{'Start Upload'| @translate}">444 <input class="submit" type="submit" name="submit_upload" value="{'Start Upload'|translate}"> 452 445 </p> 453 </form>454 455 <div id="uploadProgress" style="display:none">456 {'Photo %s of %s'|@translate|@sprintf:'<span id="progressCurrent">1</span>':'<span id="progressMax">10</span>'}457 <br>458 <div id="progressbar"></div>459 </div>460 461 <fieldset style="display:none">462 <legend>{'Uploaded Photos'|@translate}</legend>463 <div id="uploadedPhotos"></div>464 </fieldset>446 </form> 447 448 <div id="uploadProgress" style="display:none"> 449 {'Photo %s of %s'|translate:'<span id="progressCurrent">1</span>':'<span id="progressMax">10</span>'} 450 <br> 451 <div id="progressbar"></div> 452 </div> 453 454 <fieldset style="display:none"> 455 <legend>{'Uploaded Photos'|translate}</legend> 456 <div id="uploadedPhotos"></div> 457 </fieldset> 465 458 466 459 {/if} {* empty($thumbnails) *}
Note: See TracChangeset
for help on using the changeset viewer.