mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-29 03:13:40 +01:00
Mail: Add non-editable attachment block placeholder
This commit is contained in:
parent
b879b5eb7e
commit
c51f77a9dd
@ -267,7 +267,8 @@ export class et2_htmlarea extends et2_editableWidget implements et2_IResizeable
|
||||
"visualblocks visualchars image link media template fullscreen",
|
||||
"codesample table charmap hr pagebreak nonbreaking anchor toc ",
|
||||
"insertdatetime advlist lists textcolor wordcount imagetools ",
|
||||
"colorpicker textpattern help paste code searchreplace tabfocus"
|
||||
"colorpicker textpattern help paste code searchreplace tabfocus",
|
||||
"noneditable"
|
||||
],
|
||||
toolbar: et2_htmlarea.TOOLBAR_SIMPLE,
|
||||
block_formats: "Paragraph=p;Heading 1=h1;Heading 2=h2;Heading 3=h3;"+
|
||||
|
@ -1400,6 +1400,12 @@ class mail_compose
|
||||
// set filemode icons for all attachments
|
||||
if(!empty($content['attachments']))
|
||||
{
|
||||
// Make sure placeholder is there
|
||||
$attachment_block = '<fieldset class="attachments mceNonEditable"><legend>Download attachments</legend>' . lang('Attachments') . '</fieldset>';
|
||||
if($content['is_html'] && strpos($content['mail_htmltext'], $attachment_block) == false)
|
||||
{
|
||||
$content['mail_htmltext'] .= $attachment_block;
|
||||
}
|
||||
foreach($content['attachments'] as &$attach)
|
||||
{
|
||||
$attach['is_dir'] = !empty($attach['file']) && is_dir($attach['file']);
|
||||
@ -2567,13 +2573,13 @@ class mail_compose
|
||||
case 'html':
|
||||
$body = $_formData['body'];
|
||||
|
||||
static $ruler = '<hr class="ruler"';
|
||||
static $attachment_block = '<fieldset class="attachments mceNonEditable"';
|
||||
if (!empty($attachment_links))
|
||||
{
|
||||
// if we have a ruler, replace it with the attachment block
|
||||
if (strpos($body, $ruler) !== false)
|
||||
// if we have a placeholder, replace it with the attachment block
|
||||
if(strpos($body, $attachment_block) !== false)
|
||||
{
|
||||
$body = preg_replace('#'.$ruler.'[^>]*>#', $attachment_links, $body);
|
||||
$body = preg_replace('#' . $attachment_block . '[^>]*>.*</fieldset>#', $attachment_links, $body);
|
||||
}
|
||||
// else place it before the signature
|
||||
elseif (strpos($body, '<!-- HTMLSIGBEGIN -->') !== false)
|
||||
@ -2585,6 +2591,7 @@ class mail_compose
|
||||
$body .= $attachment_links;
|
||||
}
|
||||
}
|
||||
static $ruler = '<hr class="ruler"';
|
||||
$body = str_replace($ruler, '<hr', $body); // remove id from ruler, to not replace in cited mails
|
||||
|
||||
if(!empty($signature))
|
||||
|
Loading…
Reference in New Issue
Block a user