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

Revision 1036, 7.3 KB checked in by amuller, 15 years ago (diff)

Ticket #559 - Atualização de segurança

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