source: sandbox/expressoMail1_2/corretor_ortografico/index.php @ 2635

Revision 2635, 14.3 KB checked in by nathalie.silva, 11 years ago (diff)

Ticket #891 - retirada a inclusao de arquivos echo - Nathalie

  • Property svn:eol-style set to native
  • Property svn:executable set to *
Line 
1<!-- spell checker -->
2<link rel="stylesheet" type="text/css" href="spell_checker/css/spell_checker.css">
3<script src="spell_checker/cpaint/cpaint2.inc.js" type="text/javascript"></script>
4<script src="spell_checker/js/spell_checker.js" type="text/javascript"></script>
5
6<?php
7               
8        $GLOBALS['phpgw_info']['flags'] = array(
9                'noheader' => False,
10                'nonavbar' => False,
11                'currentapp' => 'expressoMail1_2',
12                'update_version'        => '1.235',
13                'enable_nextmatchs_class' => True
14        );
15       
16        require_once('../header.inc.php');
17        $update_version = $GLOBALS['phpgw_info']['flags']['update_version'];
18        $_SESSION['phpgw_info']['expressomail']['user'] = $GLOBALS['phpgw_info']['user'];
19        echo '<link rel="stylesheet" type="text/css" href="templates/'.$_SESSION['phpgw_info']['expressoMail1_2']['user']['preferences']['common']['template_set'].'/main.css">';
20        echo '<link rel="stylesheet" type="text/css" href="../phpgwapi/js/dftree/dftree.css">';
21        echo "<script type='text/javascript'>var template = '".$_SESSION['phpgw_info']['expressoMail1_2']['user']['preferences']['common']['template_set']."';</script>";
22        echo "<script src='js/modal/modal.js'></script>";
23        echo "<script src='js/globals.js?".$update_version."' type='text/javascript'></script>";
24        echo "<script src='js/sniff_browser.js?".$update_version."' type='text/javascript'></script>";
25        echo "<style type='text/css'>@import url(../phpgwapi/js/jscalendar/calendar-win2k-1.css);</style>";
26        echo "<script src='../phpgwapi/js/jscalendar/calendar.js?".$update_version."' type='text/javascript'></script>";
27        echo "<script src='../phpgwapi/js/jscalendar/calendar-setup.js?".$update_version."' type='text/javascript'></script>";
28        echo "<script src='../phpgwapi/js/jscalendar/lang/calendar-br.js?".$update_version."' type='text/javascript'></script>";
29        echo '<script type="text/javascript" src="../phpgwapi/js/wz_dragdrop/wz_dragdrop.js?'.$update_version.'"></script>
30                <script type="text/javascript" src="../phpgwapi/js/dJSWin/dJSWin.js?'.$update_version.'"></script>';
31
32       
33       
34        //Enable/Disable VoIP Service -> Voip Server Config
35        $voip_enabled = false;
36        $voip_groups = array();
37        if($GLOBALS['phpgw_info']['server']['voip_groups']) {
38                $emailVoip = false;
39                foreach(explode(",",$GLOBALS['phpgw_info']['server']['voip_groups']) as $i => $voip_group){
40                        $a_voip = explode(";",$voip_group);                     
41                        $voip_groups[] = $a_voip[1];
42                }
43                foreach($GLOBALS['phpgw']->accounts->membership() as $idx => $group){                   
44                        if(array_search($group['account_name'],$voip_groups) !== FALSE){                 
45                                $voip_enabled = true;
46                                $emailVoip = $GLOBALS['phpgw_info']['server']['voip_email_redirect'];
47                                break;
48                        }
49                }
50        }
51
52        // Get Data from ldap_manager and emailadmin.
53        $ldap_manager = CreateObject('contactcenter.bo_ldap_manager');
54        $boemailadmin   = CreateObject('emailadmin.bo');
55        $emailadmin_profile = $boemailadmin->getProfileList();
56    // Loading Admin Config Module
57    $c = CreateObject('phpgwapi.config','expressoMail1_2');
58    $c->read_repository();
59    $current_config = $c->config_data;   
60
61        $_SESSION['phpgw_info']['expressomail']['email_server'] = $boemailadmin->getProfile($emailadmin_profile[0]['profileID']);
62//      $_SESSION['phpgw_info']['expressomail']['user'] = $GLOBALS['phpgw_info']['user'];
63        $_SESSION['phpgw_info']['expressomail']['server'] = $GLOBALS['phpgw_info']['server'];
64        $_SESSION['phpgw_info']['expressomail']['ldap_server'] = $ldap_manager ? $ldap_manager->srcs[1] : null;
65        $_SESSION['phpgw_info']['expressomail']['user']['email'] = $GLOBALS['phpgw']->preferences->values['email'];
66       
67        $preferences = $GLOBALS['phpgw']->preferences->read();
68        $_SESSION['phpgw_info']['user']['preferences']['expressoMail'] = $preferences['expressoMail'];
69        $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['voip_enabled'] = $voip_enabled;
70        $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['voip_email_redirect'] = $emailVoip;
71        $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['outoffice'] = $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['outoffice'];
72        $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['telephone_number'] = $GLOBALS['phpgw_info']['user']['telephonenumber'];
73        $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['use_cache'] = $current_config['expressoMail_enable_cache'];
74        $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['number_of_contacts'] = $current_config['expressoMail_Number_of_dynamic_contacts'] ? $current_config['expressoMail_Number_of_dynamic_contacts'] : "0";
75        $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['notification_domains'] = $current_config['expressoMail_notification_domains'];
76        $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['googlegears_url'] = $current_config['expressoMail_googlegears_url'];   
77    $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['use_assinar_criptografar'] = $GLOBALS['phpgw_info']['server']['use_assinar_criptografar'] ?  $GLOBALS['phpgw_info']['server']['use_assinar_criptografar'] : "0";
78    $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['use_signature_digital_cripto'] = $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['use_signature_digital_cripto'] ? $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['use_signature_digital_cripto'] : "0";
79    $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['use_signature_digital'] = $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['use_signature_digital'] ? $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['use_signature_digital'] : "0";
80    $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['search_result_number'] = $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['search_result_number'] ? $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['search_result_number'] : "50";
81    $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['search_characters_number'] = $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['search_characters_number'] ? $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['search_characters_number'] : "4";
82    $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['num_max_certs_to_cipher'] = $GLOBALS['phpgw_info']['server']['num_max_certs_to_cipher'] ?  $GLOBALS['phpgw_info']['server']['num_max_certs_to_cipher'] : "10";
83    $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['use_signature_cripto'] = $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['use_signature_cripto'] ? $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['use_signature_cripto'] : "0";
84        $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['keep_after_auto_archiving'] = $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['keep_after_auto_archiving'] ? $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['keep_after_auto_archiving'] : "0";
85
86        $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['max_attachment_size'] = $current_config['expressoMail_Max_attachment_size'] ? $current_config['expressoMail_Max_attachment_size']."M" : ini_get('upload_max_filesize');
87        $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['max_email_per_page'] = $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['max_email_per_page'] ? $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['max_email_per_page'] : "50";
88        $template = CreateObject('phpgwapi.Template',PHPGW_APP_TPL);
89        $template->set_var("txt_loading",lang("Loading"));
90        $template->set_var("txt_clear_trash",lang("message(s) deleted from your trash folder."));
91    $template->set_var("new_message", lang("New Message"));
92        $template->set_var("lang_inbox", lang("Inbox"));
93    $template->set_var("refresh", lang("Refresh"));
94    $template->set_var("tools", lang("Tools"));
95        $template->set_var("lang_Open_Search_Window", lang("Open search window") . '...');
96        $template->set_var("lang_search_user", lang("Search user") . '...');
97        $template->set_var("upload_max_filesize",ini_get('upload_max_filesize'));
98        $template->set_var("msg_folder",$_GET['msgball']['folder']);
99        $template->set_var("msg_number",$_GET['msgball']['msgnum'] ? $_GET['msgball']['msgnum'] : $_GET['to']);
100        $template->set_var("user_email",$_SESSION['phpgw_info']['expressomail']['user']['email']);
101        $acc = CreateObject('phpgwapi.accounts');
102        $template->set_var("user_organization", $acc->get_organization($GLOBALS['phpgw_info']['user']['account_dn']));
103        $template->set_var("cyrus_delimiter",$_SESSION['phpgw_info']['expressomail']['email_server']['imapDelimiter']);
104        // Fix problem with cyrus delimiter changes in preferences.
105        // Dots in names: enabled/disabled.
106        $save_in_folder = @eregi_replace("INBOX/", "INBOX".$_SESSION['phpgw_info']['expressomail']['email_server']['imapDelimiter'], $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['save_in_folder']);
107        $save_in_folder = @eregi_replace("INBOX.", "INBOX".$_SESSION['phpgw_info']['expressomail']['email_server']['imapDelimiter'], $save_in_folder);
108        $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['save_in_folder'] = $save_in_folder;
109        // End Fix.
110       
111        $template->set_file(Array('expressoMail' => 'index.tpl'));
112        $template->set_block('expressoMail','list');
113        $template->pfp('out','list');
114        $GLOBALS['phpgw']->common->phpgw_footer();
115   
116    $_SESSION['phpgw_info']['server']['expressomail']['expressoMail_enable_log_messages'] = $current_config['expressoMail_enable_log_messages'];
117       
118    // Begin Set Anti-Spam options.
119    $_SESSION['phpgw_info']['server']['expressomail']['expressoMail_command_for_ham'] = $current_config['expressoMail_command_for_ham'];
120    $_SESSION['phpgw_info']['server']['expressomail']['expressoMail_command_for_spam'] = $current_config['expressoMail_command_for_spam'];
121    $_SESSION['phpgw_info']['server']['expressomail']['expressoMail_use_spam_filter'] = $current_config['expressoMail_use_spam_filter'];   
122    echo '<script> var use_spam_filter = \''.$current_config['expressoMail_use_spam_filter'].'\' </script>';
123        // End Set Anti-Spam options.
124
125    // Set Imap Folder names options
126
127    $_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultTrashFolder']   = $_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultTrashFolder']     ? $_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultTrashFolder']             : lang("Trash");
128    $_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultDraftsFolder']  = $_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultDraftsFolder'] ? $_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultDraftsFolder']       : lang("Drafts");
129    $_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultSpamFolder']    = $_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultSpamFolder']      ? $_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultSpamFolder']              : lang("Spam");
130    $_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultSentFolder']    = $_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultSentFolder']      ? $_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultSentFolder']              : lang("Sent");
131
132    // gera paramero com tokens suportados ....
133    $var_tokens = '';
134    for($ii = 1; $ii < 11; $ii++)
135    {
136        if($GLOBALS['phpgw_info']['server']['test_token' . $ii . '1'])
137            $var_tokens .= $GLOBALS['phpgw_info']['server']['test_token' . $ii . '1'] . ',';
138    }
139
140    if(!$var_tokens)
141    {
142        $var_tokens = 'ePass2000Lx;/usr/lib/libepsng_p11.so,ePass2000Win;c:/windows/system32/ngp11v211.dll';
143    }
144
145    echo '<script> var special_folders = new Array(4);
146        special_folders["'.$_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultTrashFolder'].'"] = \'Trash\';
147    special_folders["'.$_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultDraftsFolder'].'"] = \'Drafts\';
148    special_folders["'.$_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultSpamFolder'].'"] = \'Spam\';
149    special_folders["'.$_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultSentFolder'].'"] = \'Sent\';
150    var trashfolder = "'.$_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultTrashFolder'].'";
151    var draftsfolder = "'.$_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultDraftsFolder'].'";
152    var sentfolder = "'.$_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultSentFolder'].'";
153    var spamfolder = "'.$_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultSpamFolder'].'";
154    var token_param = "'.$var_tokens.'";
155    var locale = "'.$GLOBALS['phpgw']->common->getPreferredLanguage().'";
156    </script>';
157
158        // End Set Imap Folder names options
159        //User info
160        echo "<script language='javascript'> var account_id = ".$GLOBALS['phpgw_info']['user']['account_id'].";var expresso_offline = false;</script>";
161
162        $obj = createobject("expressoMail1_2.functions");
163        // este arquivo deve ser carregado antes que
164        // os demais pois nele contem a função get_lang
165        // que é utilizada em diversas partes
166        echo $obj -> getFilesJs("js/common_functions.js");
167        include("inc/load_lang.php");
168
169        echo $GLOBALS['phpgw']->common->get_java_script();
170        // INCLUDE these JS Files:
171        if ($_SESSION['phpgw_info']['user']['preferences']['expressoMail']['use_local_messages'])
172                echo "<script src='js/gears_init.js'></script>";
173        echo $obj -> getFilesJs("js/abas.js," .
174                                                        "js/doiMenuData.js," .
175                                                        "js/drag_area.js," .
176                                                        "js/draw_api.js," .
177                                                        "js/DropDownContacts.js," .
178                                                        "js/InfoContact.js," .
179                                                        "js/main.js," .
180                                                        "js/local_messages.js," .
181                                                        "js/messages_controller.js," .
182                                                        "js/rich_text_editor.js," .
183//                                                      "js/mail_sync.js," .
184                                                        "js/wfolders.js,",
185                                                        $GLOBALS['phpgw_info']['flags']['update_version']);
186
187        if ($GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['use_shortcuts'])
188        {
189                echo $obj -> getFilesJs("js/shortcut.js", $GLOBALS['phpgw_info']['flags']['update_version']);
190        }
191
192        // Get Preferences or redirect to preferences page.
193        $GLOBALS['phpgw']->preferences->read_repository();
194        //print_r($_SESSION['phpgw_info']['user']['preferences']['expressoMail']);
195?>
196
197<html>
198<head>
199<title>ExpressoMail</title>
200
201</head>
202<body scroll="no" style="overflow:hidden">
203</body>
204</html>
205<script src="../phpgwapi/js/dftree/dftree.js?<?=$update_version?>" type="text/javascript"></script>
206<script language="Javascript">expresso.connector.updateVersion = "<?php echo $update_version ?>";init();</script>
207<!-----Expresso Mail - Version Updated:<?=$update_version?>-------->
208
209
Note: See TracBrowser for help on using the repository browser.