Changeset 3412 in subversion for trunk/roundcubemail/program/steps/mail/func.inc
- Timestamp:
- Mar 24, 2010 6:06:23 AM (3 years ago)
- File:
-
- 1 edited
-
trunk/roundcubemail/program/steps/mail/func.inc (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/roundcubemail/program/steps/mail/func.inc
r3410 r3412 939 939 940 940 if ($part->ctype_secondary == 'html') 941 $out .= html::div('message-htmlpart', rcmail_html4inline($body, $attrib['id'] . 'div.rcmBody'));941 $out .= html::div('message-htmlpart', rcmail_html4inline($body, $attrib['id'], 'div.rcmBody')); 942 942 else 943 943 $out .= html::div('message-part', $body); … … 998 998 * modify a HTML message that it can be displayed inside a HTML page 999 999 */ 1000 function rcmail_html4inline($body, $container_id )1000 function rcmail_html4inline($body, $container_id, $body_id='') 1001 1001 { 1002 1002 $last_style_pos = 0; … … 1009 1009 1010 1010 // replace all css definitions with #container [def] 1011 $styles = rcmail_mod_css_styles(substr($body, $pos, $pos2-$pos), $container_id );1011 $styles = rcmail_mod_css_styles(substr($body, $pos, $pos2-$pos), $container_id.($body_id ? ' '.$body_id : '')); 1012 1012 1013 1013 $body = substr($body, 0, $pos) . $styles . substr($body, $pos2); … … 1021 1021 unset($GLOBALS['rcmail_html_container_id']); 1022 1022 1023 // add comments arround html and other tags1024 1023 $out = preg_replace(array( 1024 // add comments arround html and other tags 1025 1025 '/(<!DOCTYPE[^>]*>)/i', 1026 1026 '/(<\?xml[^>]*>)/i', … … 1028 1028 '/(<\/?head[^>]*>)/i', 1029 1029 '/(<title[^>]*>.*<\/title>)/Ui', 1030 '/(<\/?meta[^>]*>)/i'), 1031 '<!--\\1-->', 1030 '/(<\/?meta[^>]*>)/i', 1031 // quote <? of php and xml files that are specified as text/html 1032 '/<\?/', 1033 '/\?>/', 1034 // replace <body> with <div> 1035 '/<body([^>]*)>/i', 1036 '/<\/body>/i', 1037 ), 1038 array( 1039 '<!--\\1-->', 1040 '<!--\\1-->', 1041 '<!--\\1-->', 1042 '<!--\\1-->', 1043 '<!--\\1-->', 1044 '<!--\\1-->', 1045 '<?', 1046 '?>', 1047 '<div class="rcmBody"\\1>', 1048 '</div>', 1049 ), 1032 1050 $body); 1033 1051 1034 $out = preg_replace( 1035 array('/<body([^>]*)>/i', '/<\/body>/i'), 1036 array('<div class="rcmBody"\\1>', '</div>'), 1037 $out); 1038 1052 // make sure there's 'rcmBody' div, we need it for proper css modification 1053 // its name is hardcoded in rcmail_message_body() also 1039 1054 if (!preg_match('/<div class="rcmBody"/', $out)) 1040 1055 $out = '<div class="rcmBody">' . $out . '</div>'; 1041 1042 // quote <? of php and xml files that are specified as text/html1043 $out = preg_replace(array('/<\?/', '/\?>/'), array('<?', '?>'), $out);1044 1056 1045 1057 return $out;
Note: See TracChangeset
for help on using the changeset viewer.
