W.I.P. of mail toggled on actions preferences

This commit is contained in:
Hadi Nategh 2018-07-13 10:26:48 +02:00
parent 15f0900c03
commit 32f50567f0
2 changed files with 47 additions and 3 deletions

View File

@ -112,7 +112,7 @@ class mail_compose
*
* @return array an array of actions
*/
function getToolbarActions($content)
static function getToolbarActions($content)
{
$group = 0;
$actions = array(
@ -215,7 +215,7 @@ class mail_compose
),
);
$acc_smime = Mail\Smime::get_acc_smime($this->mail_bo->profileID);
$acc_smime = Mail\Smime::get_acc_smime($content['mailaccount']);
if ($acc_smime['acc_smime_password'])
{
$actions = array_merge($actions, array(
@ -1274,7 +1274,7 @@ class mail_compose
//$GLOBALS['egw_info']['flags']['currentapp'] = 'mail';//should not be needed
$etpl = new Etemplate('mail.compose');
$etpl->setElementAttribute('composeToolbar', 'actions', $this->getToolbarActions($_content));
$etpl->setElementAttribute('composeToolbar', 'actions', self::getToolbarActions($content));
if ($content['mimeType']=='html')
{
//mode="$cont[rtfEditorFeatures]" validation_rules="$cont[validation_rules]" base_href="$cont[upload_dir]"

View File

@ -181,6 +181,43 @@ class mail_hooks
// modify folderlist, add a none entry, to be able to force the regarding settings, if no folders apply
$folderList['none'] = lang('no folders');
// Build toogled on actions sel options
$allActions = array_merge(mail_compose::getToolbarActions(array(
'priority' => true,
'mailaccount' => $GLOBALS['egw_info']['user']['preferences']['mail']['ActiveProfileID']
)));
$toggledOnActions = array (
'mail_compose.cc_expander' => array (
'id' => 'mail_compose.cc_expander',
'label' => lang('Cc'),
),
'mail_compose.bcc_expander' => array (
'id' => 'mail_compose.bcc_expander',
'label' => lang('Bcc')
),
'mail_compose.folder_expander' => array(
'id' => 'mail_compose.folder_expander',
'label' => lang('Folder')
),
'mail_compose.replyto_expander' => array(
'id' => 'mail_compose.replyto_expander',
'label' => lang('Reply to')
)
);
foreach($allActions as $name => $action)
{
if ($action['checkbox'])
{
$toggledOnActions['mail_compose.'.$name] = array(
'id' => 'mail_compose.'.$name,
'label' => lang($action['caption']),
'title' => lang($action['hint']),
'app' => 'mail'
);
}
}
/* Settings array for this app */
$settingsArray = array(
array(
@ -368,6 +405,13 @@ class mail_hooks
),
'default' => 'vertical'
),
'toggledOnActions' => array(
'type' => 'taglist',
'label' => 'Toggled on actions',
'help' => 'List of actions to be switched/activated on by default',
'name' => 'toggledOnActions',
'values' => $toggledOnActions
)
);
if (!$GLOBALS['egw_info']['apps']['stylite']) unset($settingsArray['attachVCardAtCompose']);
return $settingsArray;