mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-21 23:43:17 +01:00
Added mail_compose_prepare hook to allow manipulation of compose dialog via other apps
This commit is contained in:
parent
7723488be1
commit
968b2ab219
@ -1424,8 +1424,29 @@ class mail_compose
|
|||||||
if (isset($content['to'])) $content['to'] = self::resolveEmailAddressList($content['to']);
|
if (isset($content['to'])) $content['to'] = self::resolveEmailAddressList($content['to']);
|
||||||
$content['html_toolbar'] = empty(Mail::$mailConfig['html_toolbar']) ?
|
$content['html_toolbar'] = empty(Mail::$mailConfig['html_toolbar']) ?
|
||||||
implode(',', Etemplate\Widget\HtmlArea::$toolbar_default_list) : implode(',', Mail::$mailConfig['html_toolbar']);
|
implode(',', Etemplate\Widget\HtmlArea::$toolbar_default_list) : implode(',', Mail::$mailConfig['html_toolbar']);
|
||||||
|
|
||||||
|
//Allow other apps to hook into mail_compose
|
||||||
|
$readonlys = [];
|
||||||
|
$temp = Api\Hooks::process( array(
|
||||||
|
'location' => 'mail_compose_prepare',
|
||||||
|
'content' => $content,
|
||||||
|
'readonlys' => $readonlys,
|
||||||
|
'sel_options' => $sel_options
|
||||||
|
));
|
||||||
|
|
||||||
|
foreach ($temp as $hook){
|
||||||
|
if($hook){
|
||||||
|
$content = array_merge($content, $hook['content']);
|
||||||
|
$readonlys = array_merge($readonlys,$hook['readonlys']);
|
||||||
|
$preserv = array_merge($readonlys, $hook['preserv']);
|
||||||
|
$sel_options = array_merge($readonlys, $hook['sel_options']);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
unset($temp,$hook);
|
||||||
|
|
||||||
//error_log(__METHOD__.__LINE__.array2string($content));
|
//error_log(__METHOD__.__LINE__.array2string($content));
|
||||||
$etpl->exec('mail.mail_compose.compose',$content,$sel_options,array(),$preserv,2);
|
$etpl->exec('mail.mail_compose.compose',$content,$sel_options,$readonlys,$preserv,2);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user