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

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

Ticket #485 - Correção de erro de digitação nas preferencias

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