source: trunk/expressoMail1_2/inc/hook_settings.inc.php @ 1035

Revision 1035, 7.1 KB checked in by rafaelraymundo, 15 years ago (diff)

Ticket #558 - Adicionada funcionalidade de assinatura e criptografia de e-mails.

  • Property svn:executable set to *
Line 
1<?php
2        /**************************************************************************\
3        * eGroupWare - ExpressoMail Preferences                                    *
4        * http://www.expressolivre.org                                             *   
5        * Modified by Alexandre Felipe Muller de Souza <amuller@celepar.pr.gov.br> *
6        * --------------------------------------------                             *
7        *  This program is free software; you can redistribute it and/or modify it *
8        *  under the terms of the GNU General Public License as published by the   *
9        *  Free Software Foundation; either version 2 of the License, or (at your  *
10        *  option) any later version.                                              *
11        \**************************************************************************/
12include_once("fckeditor.php");
13$type = $_GET['type']; // FIX ME
14
15//if ($type == 'user' || $type == ''){
16create_html_code('<script language="JavaScript" type="text/javascript">
17function exibir_ocultar()
18{
19    var type = ("'.$type.'" == "") ? "user" : "'.$type.'";
20    var use_signature_digital_cripto = document.getElementsByName(type+"[use_signature_digital_cripto]")[0];
21    var default_signature_digital_cripto = "'.$GLOBALS['phpgw_info']['default']['preferences']['expressoMail']['use_signature_digital_cripto'].'";
22
23    if (use_signature_digital_cripto)
24    {
25        var element_signature_digital = document.getElementById(type+"[use_signature_digital]");
26        var element_signature_cripto = document.getElementById(type+"[use_signature_cripto]");
27
28        switch (use_signature_digital_cripto[use_signature_digital_cripto.selectedIndex].value){
29
30            case "1":
31                element_signature_digital.style.display="";
32                element_signature_cripto.style.display="";
33                break;
34            case "0":
35                element_signature_digital.style.display="none";
36                element_signature_cripto.style.display="none";
37                break;
38            case "":
39                if (default_signature_digital_cripto){
40                    element_signature_digital.style.display="";
41                    element_signature_cripto.style.display="";
42                 }
43                 else
44                 {
45                    element_signature_digital.style.display="none";
46                    element_signature_cripto.style.display="none";
47                 }
48
49        }
50
51    }
52
53}
54
55</script>');
56//}
57
58$default = array(
59        '25'    => '25',
60        '50'    => '50',
61        '75'    => '75',
62        '100'   => '100'
63);
64
65create_select_box('What is the maximum number of messages per page?','max_email_per_page',$default,
66        'What is the maximum number of messages per page?');
67create_check_box('Save deleted messages in trash folder?','save_deleted_msg','Save deleted messages in trash folder?');
68$default = array(
69        '1'    => lang('1 day'),
70        '2'    => lang('2 days'),
71        '3'    => lang('3 days'),
72        '4'   => lang('4 days'),
73        '5'   => lang('5 days')
74);
75
76create_select_box('Delete trash messages after how many days?','delete_trash_messages_after_n_days',$default,lang('Delete trash messages after how many days?'));
77create_check_box('Would you like to use local messages?','use_local_messages','');
78create_check_box('Would you like to keep archived messages?','keep_archived_messages','');
79create_check_box('Show previous message, after delete actual message?','delete_and_show_previous_message','');
80create_check_box('Do you wanna receive an alert for new messages?','alert_new_msg','');
81create_check_box('Show default view on main screen?','mainscreen_showmail','');
82create_check_box('Do you want to use remove attachments function?','remove_attachments_function','');
83create_check_box('Do you want to use important flag in email editor?','enable_important_flag','');
84
85//TODO use default folders from email admin
86$default = array(
87        'INBOX' =>      lang('INBOX'),
88        'INBOX/'.lang('Drafts') => lang('Drafts'),
89        'INBOX/'.lang('Sent')   => lang('Sent'),
90        'INBOX/'.lang('Trash')  => lang('Trash')
91);
92create_select_box('Save sent messages in folder','save_in_folder',$default,'');
93create_check_box('Hide menu folders?','check_menu','');
94
95$default = array(
96        '20' => lang('normal'),
97        '30' => lang('medium'),
98        '40' => lang('big')
99);
100
101create_select_box('What is the height of the lines in the list of messages?','line_height',$default,'');
102$default = array(
103        '10' => lang('small'),
104        '11' => lang('normal'),
105        '15' => lang('big')
106);
107
108create_select_box('What the font size in the list of messages?','font_size',$default,'');
109create_check_box('Use dynamic contacts?','use_dynamic_contacts','');
110create_check_box('Use shortcuts?','use_shotcuts','');
111create_check_box('Auto save draft','auto_save_draft','');
112$default = array(
113        '65536' => lang('unlimited'),
114        '640' => '640',
115        '768' => '768',
116        '800' => '800',
117        '1024' => '1024',
118        '1080' => '1080'
119);
120
121create_select_box('What is the maximum size of embedded images'."?",'image_size',$default,'');
122
123if($GLOBALS['phpgw_info']['server']['use_assinar_criptografar'])
124{
125    create_check_box('Enable digitally sign/cipher the message?','use_signature_digital_cripto','','',True,'onchange="javascript:exibir_ocultar();"');
126    if ($GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['use_signature_digital_cripto'])
127    {
128        create_check_box('Always sign message digitally?','use_signature_digital','');
129        create_check_box('Always cipher message digitally?','use_signature_cripto','');
130    }
131    else
132    {
133        create_check_box('Always sign message digitally?','use_signature_digital','','',True,'',False);
134        create_check_box('Always cipher message digitally?','use_signature_cripto','','',True,'',False);
135    }
136}
137
138$default = array(
139        'text' => lang('simple text'),
140        'html' => lang('rich text')
141);
142
143create_select_box('Signature Type','type_signature',$default,'','','','onchange="javascript:changeType(this.value);" onload="javascript:alert(this.value);"');
144
145if ($type == 'user' || $type == ''){
146        $oFCKeditor = new FCKeditor('html_signature');
147        $oFCKeditor->BasePath   = '../expressoMail1_2/js/fckeditor/';
148        $oFCKeditor->ToolbarSet = 'ExpressoLivre';
149
150        $vars = $GLOBALS['phpgw']->preferences->user[$appname];
151
152        create_html_code("signature","<div id='text_signature'>
153                <textarea rows='5' cols='50' id='user[signature]' name='user[signature]'>","</textarea></div>
154                <div style='display:none;' id='html_signature'>".$oFCKeditor->Create()."</div>
155                <script language='javascript'>
156document.getElementById('user[signature]').value  = '".$vars['signature']."';
157function changeType(value){
158        var html_signature = FCKeditorAPI.GetInstance(\"html_signature\");
159        if(value == 'text'){
160                document.getElementById('user[signature]').value = html_signature.GetHTML();
161                document.getElementById(\"text_signature\").style.display = '';
162                document.getElementById(\"html_signature\").style.display = 'none';
163        }
164        else if(value == 'html'){       
165                html_signature.SetHTML(document.getElementById('user[signature]').value);
166                document.getElementById(\"text_signature\").style.display = 'none';
167                document.getElementById(\"html_signature\").style.display  = '';
168        }
169}
170setTimeout('changeType(document.getElementsByName(\'user[type_signature]\')[0].value==\'html\'?\'html\':\'\')',2500);
171document.getElementById('user[signature]').value=document.getElementById('user[signature]').innerHTML;
172</script>");
173}
174?>
Note: See TracBrowser for help on using the repository browser.