Changeset 7fc056c3 in github


Ignore:
Timestamp:
May 3, 2011 4:18:40 AM (2 years ago)
Author:
alecpl <alec@…>
Branches:
master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
Children:
1abb97f
Parents:
4d7fbd5
Message:
  • Enable multiselection for attachments uploading in capable browsers (#1485969)
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • CHANGELOG

    r2d889ec r7fc056c3  
    22=========================== 
    33 
     4- Enable multiselection for attachments uploading in capable browsers (#1485969) 
    45- Add possibility to change HTML editor configuration by skin 
    56- Fix a bug where selecting too many contacts would produce too large URI request (#1487892) 
  • program/include/html.php

    r6f6efa2 r7fc056c3  
    272272    protected $allowed = array('type','name','value','size','tabindex', 
    273273        'autocomplete','checked','onchange','onclick','disabled','readonly', 
    274         'spellcheck','results','maxlength','src'); 
     274        'spellcheck','results','maxlength','src','multiple'); 
    275275 
    276276    /** 
  • program/js/app.js

    rcf58ce8 r7fc056c3  
    474474    // trigger plugin hooks 
    475475    this.triggerEvent('actionbefore', {props:props, action:command}); 
    476     var event_ret = this.triggerEvent('before'+command, props); 
    477     if (event_ret !== undefined) { 
     476    var ret = this.triggerEvent('before'+command, props); 
     477    if (ret !== undefined) { 
    478478      // abort if one the handlers returned false 
    479       if (event_ret === false) 
     479      if (ret === false) 
    480480        return false; 
    481481      else 
    482         props = event_ret; 
     482        props = ret; 
    483483    } 
    484484 
     
    31723172      return false; 
    31733173 
    3174     // get file input fields 
    3175     var send = false; 
    3176     for (var n=0; n<form.elements.length; n++) 
    3177       if (form.elements[n].type=='file' && form.elements[n].value) { 
    3178         send = true; 
    3179         break; 
    3180       } 
     3174    // get file input field, count files on capable browser 
     3175    var field = $('input[type=file]', form).get(0), 
     3176      files = field.files ? field.files.length : field.value ? 1 : 0; 
    31813177 
    31823178    // create hidden iframe and post upload form 
    3183     if (send) { 
     3179    if (files) { 
    31843180      var frame_name = this.async_upload_form(form, 'upload', function(e) { 
    31853181        var d, content = ''; 
     
    32043200 
    32053201      // display upload indicator and cancel button 
    3206       var content = this.get_label('uploading'), 
     3202      var content = this.get_label('uploading' + (files > 1 ? 'many' : '')), 
    32073203        ts = frame_name.replace(/^rcmupload/, ''); 
    32083204 
     
    32263222      return false; 
    32273223 
    3228     var li = $('<li>').attr('id', name).html(att.html); 
    3229     var indicator; 
     3224    var indicator, li = $('<li>').attr('id', name).html(att.html); 
    32303225 
    32313226    // replace indicator's li 
     
    32543249 
    32553250    var list = this.gui_objects.attachmentlist.getElementsByTagName("li"); 
    3256     for (i=0;i<list.length;i++) 
     3251    for (i=0; i<list.length; i++) 
    32573252      if (list[i].id == name) 
    32583253        this.gui_objects.attachmentlist.removeChild(list[i]); 
  • program/steps/mail/compose.inc

    rfc072bf r7fc056c3  
    11491149  if ($max_postsize && $max_postsize < $max_filesize) 
    11501150    $max_filesize = $max_postsize; 
     1151 
     1152  $OUTPUT->set_env('max_filesize', $max_filesize); 
    11511153  $max_filesize = show_bytes($max_filesize); 
    11521154   
     
    11731175  $attrib['type'] = 'file'; 
    11741176  $attrib['name'] = '_attachments[]'; 
     1177  $attrib['multiple'] = 'multiple'; 
     1178 
    11751179  $field = new html_inputfield($attrib); 
    11761180  return $field->show(); 
Note: See TracChangeset for help on using the changeset viewer.