Changeset 0207c45 in github for program/steps/mail/compose.inc


Ignore:
Timestamp:
Nov 2, 2009 4:58:14 AM (4 years ago)
Author:
thomascube <thomas@…>
Branches:
master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
Children:
f8a216eb
Parents:
31ddb5e
Message:

More options for top posting feature (#1484272) using patch from Phil Weir

File:
1 edited

Legend:

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

    r50f56d2 r0207c45  
    104104// set current mailbox in client environment 
    105105$OUTPUT->set_env('mailbox', $IMAP->get_mailbox_name()); 
     106$OUTPUT->set_env('sig_above', $CONFIG['sig_above']); 
    106107$OUTPUT->set_env('top_posting', $CONFIG['top_posting']); 
    107108 
     
    118119} 
    119120 
    120 if (!$CONFIG['show_sig']) 
     121$config_show_sig = $RCMAIL->config->get('show_sig', 1); 
     122if ($config_show_sig == 1) 
    121123  $OUTPUT->set_env('show_sig', true); 
    122 else if ($CONFIG['show_sig'] == 2 && empty($compose_mode)) 
     124else if ($config_show_sig == 2 && (empty($compose_mode) || $compose_mode == RCUBE_COMPOSE_EDIT || $compose_mode == RCUBE_COMPOSE_DRAFT)) 
    123125  $OUTPUT->set_env('show_sig', true); 
    124 else if ($CONFIG['show_sig'] == 3 && ($compose_mode == RCUBE_COMPOSE_REPLY || $compose_mode == RCUBE_COMPOSE_FORWARD)) 
     126else if ($config_show_sig == 3 && ($compose_mode == RCUBE_COMPOSE_REPLY || $compose_mode == RCUBE_COMPOSE_FORWARD)) 
    125127  $OUTPUT->set_env('show_sig', true); 
     128else 
     129  $OUTPUT->set_env('show_sig', false); 
    126130 
    127131if (!empty($msg_uid)) 
     
    519523function rcmail_create_reply_body($body, $bodyIsHtml) 
    520524{ 
    521   global $MESSAGE; 
    522    
    523   $rcmail = rcmail::get_instance(); 
    524  
    525   if (! $bodyIsHtml) 
    526   { 
     525  global $RCMAIL, $MESSAGE; 
     526 
     527  if (!$bodyIsHtml) { 
    527528    // try to remove the signature 
    528     if (!$rcmail->config->get('top_posting') && ($sp = strrpos($body, '-- ')) !== false && ($sp == 0 || $body{$sp-1} == "\n")) 
    529       { 
     529    if ($RCMAIL->config->get('strip_existing_sig', true) && ($sp = strrpos($body, '-- ')) !== false && ($sp == 0 || $body{$sp-1} == "\n")) { 
    530530      if ($body{$sp+3}==' ' || $body{$sp+3}=="\n" || $body{$sp+3}=="\r") 
    531531        $body = substr($body, 0, max(0, $sp-1)); 
    532       } 
     532    } 
    533533 
    534534    // soft-wrap message first 
     
    542542 
    543543      // add > to each line 
    544       for($n=0; $n<sizeof($a_lines); $n++) { 
     544      for ($n=0; $n<sizeof($a_lines); $n++) { 
    545545        if (strpos($a_lines[$n], '>')===0) 
    546546          $a_lines[$n] = '>'.$a_lines[$n]; 
    547547        else 
    548548          $a_lines[$n] = '> '.$a_lines[$n]; 
    549         } 
     549      } 
    550550  
    551551      $body = join("\n", $a_lines); 
    552       } 
     552    } 
    553553 
    554554    // add title line(s) 
     
    558558 
    559559    $suffix = ''; 
    560  
    561     if ($rcmail->config->get('top_posting')) 
     560     
     561    if ($RCMAIL->config->get('top_posting')) 
    562562      $prefix = "\n\n\n" . $prefix; 
    563563  } 
    564   else 
    565   { 
     564  else { 
    566565    // save inline images to files 
    567566    $cid_map = rcmail_write_inline_attachments($MESSAGE); 
     
    574573    $prefix = sprintf("On %s, %s wrote:<br />\n", 
    575574      $MESSAGE->headers->date, 
    576       htmlspecialchars(Q($MESSAGE->get_header('from'), 'replace'), ENT_COMPAT, $rcmail->output->get_charset())); 
     575      htmlspecialchars(Q($MESSAGE->get_header('from'), 'replace'), ENT_COMPAT, $RCMAIL->output->get_charset())); 
    577576    $prefix .= '<blockquote type="cite" style="padding-left:5px; border-left:#1010ff 2px solid; margin-left:5px; width:100%">'; 
    578  
    579     if ($rcmail->config->get('top_posting')) { 
    580           $prefix = "<p></p>" . $prefix; 
    581           $suffix = "</blockquote>"; 
     577     
     578    if ($RCMAIL->config->get('top_posting')) { 
     579      $prefix = "<p></p>" . $prefix; 
     580      $suffix = "</blockquote>"; 
    582581    } 
    583582    else { 
Note: See TracChangeset for help on using the changeset viewer.