Changeset a894ba5 in github for program/steps/mail/compose.inc


Ignore:
Timestamp:
Jun 29, 2006 7:41:40 PM (7 years ago)
Author:
svncommit <devs@…>
Branches:
master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
Children:
25d8ba6
Parents:
ba8f44c
Message:

Removeable attachments, Auto-default folder creation, bug fixes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • program/steps/mail/compose.inc

    r1966c53 ra894ba5  
    3333  $_SESSION['compose'] = array('id' => uniqid(rand())); 
    3434 
     35// remove an attachment 
     36if ($_action=='remove-attachment' && !empty($_GET['_filename'])) 
     37  { 
     38  if (is_array($_SESSION['compose']['attachments'])) 
     39    foreach ($_SESSION['compose']['attachments'] as $i => $attachment) 
     40      if ($attachment['name'] == $_GET['_filename']) 
     41        { 
     42        @unlink($attachment['path']); 
     43        unset($_SESSION['compose']['attachments'][$i]); 
     44        $commands = sprintf("parent.%s.remove_from_attachment_list('%s');\n", $JS_OBJECT_NAME, $_GET['_filename']); 
     45        rcube_remote_response($commands);   
     46        exit; 
     47        } 
     48  } 
    3549 
    3650// add some labels to client 
     
    612626  if (is_array($_SESSION['compose']['attachments'])) 
    613627    { 
     628    if ($attrib['deleteicon']) 
     629      $button = sprintf('<img src="%s%s" alt="%s" border="0" / style="padding-right:2px;vertical-align:middle">', $CONFIG['skin_path'], $attrib['deleteicon'], rcube_label('delete')); 
     630    else 
     631      $button = rcube_label('delete'); 
     632 
    614633    foreach ($_SESSION['compose']['attachments'] as $i => $a_prop) 
    615       $out .= sprintf("<li>%s</li>\n", $a_prop['name']); 
     634      $out .= sprintf('<li id="%s"><a href="#" onclick="%s.command(\'remove-attachment\',\'%s\')" title="%s">%s</a>%s</li>', $a_prop['name'], $JS_OBJECT_NAME, $a_prop['name'], rcube_label('deletefolder'),  $button, $a_prop['name']);  
    616635    } 
    617636 
     
    664683  } 
    665684 
    666  
    667685function rcmail_priority_selector($attrib) 
    668686  { 
Note: See TracChangeset for help on using the changeset viewer.