Ignore:
Timestamp:
Jan 1, 2014, 11:34:30 AM (10 years ago)
Author:
mistic100
Message:

update for 2.6

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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'}
    55
    66{if $upload_mode == 'multiple'}
     
    88{combine_script id='jquery.jgrowl' load='footer' require='jquery' path='themes/default/js/plugins/jquery.jgrowl_minimized.js' }
    99{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'}
    1111{/if}
    1212
     
    1616
    1717{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();
    3323    return false;
    3424  });
    3525 
    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();
    3929    return false;
    4030  });
    4131 
    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();
    4535    return false;
    4636  });
    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    }
    6265  }
    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,'')
    6969  }
    7070
    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}">&nbsp;</a></td>'+
     128        '</tr>';
     129      }
     130     
     131      $('table#links tbody').append(html);
     132    }
     133   
     134    $input.focus();
    73135    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    });
    74199  }
    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'] +'">&nbsp;</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     
    207226    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  });
    238233
    239234
    240235{* <!-- SINGLE UPLOAD --> *}
    241236{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    }
    252271  }
    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  });
    283276{/if}
    284277
     278}(jQuery));
    285279{/footer_script}
    286280
    287281
    288 {html_head}{literal}
    289 <style type="text/css">
     282{html_style}
    290283a.delete {
    291284  background:url('admin/include/uploadify/cancel.png');
    292285}
    293 </style>
    294 {/literal}{/html_head}
     286{/html_style}
    295287
    296288
    297289<div class="titrePage">
    298   <h2>{'Upload Photos'|@translate} {$TABSHEET_TITLE}</h2>
     290  <h2>{'Upload Photos'|translate} {$TABSHEET_TITLE}</h2>
    299291</div>
    300292
     
    302294
    303295{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>
    311303{else}
    312304
    313   {if count($setup_warnings) > 0}
    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   {/if}
     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}
    323315 
    324316{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>
    333342  </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">
    351345    <fieldset>
    352       <legend>{'Drop into album'|@translate}</legend>
     346      <legend>{'Drop into album'|translate}</legend>
    353347
    354348      <span id="albumSelection"{if count($category_options) == 0} style="display:none"{/if}>
     
    356350        {html_options options=$category_options selected=$category_options_selected}
    357351      </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>
    359353     
    360354    </fieldset>
    361355
    362356    <fieldset>
    363       <legend>{'Select files'|@translate}</legend>
     357      <legend>{'Select files'|translate}</legend>
    364358     
    365359      <p id="uploadWarningsSummary">
    366         {'Allowed file types: %s.'|@translate|@sprintf:$upload_file_types}
     360        {'Allowed file types: %s.'|translate:$upload_file_types}
    367361      {if isset($max_upload_resolution)}
    368362        {$max_upload_resolution}Mpx
    369         <a class="showInfo" title="{'Learn more'|@translate}">i</a>
     363        <a class="showInfo" title="{'Learn more'|translate}">i</a>
    370364      {/if}
    371365      </p>
    372366
    373367      <p id="uploadWarnings">
    374         {'Allowed file types: %s.'|@translate|@sprintf:$upload_file_types}
     368        {'Allowed file types: %s.'|translate:$upload_file_types}
    375369      {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}
    377371      {/if}
    378372      </p>
    379373
    380374{* <!-- SINGLE UPLOAD --> *}
    381 {if $upload_mode == 'single'}
     375    {if $upload_mode == 'single'}
    382376      <ul>
    383377        <li>
    384378          <label>
    385             <span class="property">{'File URL'|@translate}</span>
     379            <span class="property">{'File URL'|translate}</span>
    386380            <input type="text" name="file_url" size="70">
    387381          </label>
     
    389383        <li>
    390384          <label>
    391             <span class="property">{'Photo name'|@translate}</span>
     385            <span class="property">{'Photo name'|translate}</span>
    392386            <input type="text" name="photo_name" size="40">
    393387          </label>
     
    396390          <label>
    397391            <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}
    399393          </label>
    400394        </li>
    401395      </ul>     
    402396     
    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>
    404398
    405399{* <!-- MULTIPLE UPLOAD --> *}
    406 {else}
    407 
     400    {else}
    408401      <table id="links" class="table2" style="display:none;">
    409402        <thead>
    410403          <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>
    414407            <th style="width:20px;"></th>
    415408          </tr>
     
    417410        <tbody>
    418411        </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>
    427412      </table>
    428413     
    429414      <p>
    430         {'One link by line, separate photo name and url with a &laquo; | &raquo;. Photo name is optional.'|@translate}
     415        {'One link by line, separate photo name and url with a &laquo; | &raquo;. Photo name is optional.'|translate}
    431416        <br>
    432417        <textarea id="urls"></textarea>
    433418      </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}
    438431    </fieldset>
    439432
    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>
    441434
    442435    <fieldset id="permissions" style="display:none">
    443       <legend>{'Who can see these photos?'|@translate}</legend>
     436      <legend>{'Who can see these photos?'|translate}</legend>
    444437
    445438      <select name="level" size="1">
     
    449442   
    450443    <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}">
    452445    </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>
    465458
    466459{/if} {* empty($thumbnails) *}
Note: See TracChangeset for help on using the changeset viewer.