faaff93a0142b8ae03ca3b7ebbfe33c9a6f0315d
5 * Copyright (c) 1999-2004 The SquirrelMail Project Team
6 * Licensed under the GNU GPL. For full terms see the file COPYING.
8 * Pick your translator to translate the body of incoming mail messages
12 * @subpackage translate
16 * Path for SquirrelMail required files.
19 define('SM_PATH','../../');
21 /* SquirrelMail required files. */
22 include_once(SM_PATH
. 'include/validate.php');
23 include_once(SM_PATH
. 'functions/display_messages.php');
24 include_once(SM_PATH
. 'functions/imap.php');
25 include_once(SM_PATH
. 'plugins/translate/functions.php');
27 displayPageHeader($color, 'None');
30 if (sqgetGlobalVar('submit_translate',$tmp,SQ_POST
)) {
31 if (sqgetGlobalVar('translate_translate_server',$translate_translate_server,SQ_POST
)) {
32 setPref($data_dir, $username, 'translate_server', $translate_translate_server);
34 setPref($data_dir, $username, 'translate_server', $translate_default_engine);
37 if (sqgetGlobalVar('translate_translate_location',$translate_translate_location,SQ_POST
)) {
38 setPref($data_dir, $username, 'translate_location', $translate_translate_location);
40 setPref($data_dir, $username, 'translate_location', 'center');
43 if (sqgetGlobalVar('translate_translate_show_read',$tmp,SQ_POST
)) {
44 setPref($data_dir, $username, 'translate_show_read', '1');
46 setPref($data_dir, $username, 'translate_show_read', '');
49 if (sqgetGlobalVar('translate_translate_show_send',$tmp,SQ_POST
)) {
50 setPref($data_dir, $username, 'translate_show_send', '1');
52 setPref($data_dir, $username, 'translate_show_send', '');
55 if (sqgetGlobalVar('translate_translate_same_window',$tmp,SQ_POST
)) {
56 setPref($data_dir, $username, 'translate_same_window', '1');
58 setPref($data_dir, $username, 'translate_same_window', '');
62 // Move these calls to separate function
63 $translate_server = getPref($data_dir, $username, 'translate_server',$translate_default_engine);
65 $translate_location = getPref($data_dir, $username, 'translate_location');
66 if ($translate_location == '') {
67 $translate_location = 'center';
69 $translate_show_read = getPref($data_dir, $username, 'translate_show_read');
70 $translate_show_send = getPref($data_dir, $username, 'translate_show_send');
71 $translate_same_window = getPref($data_dir, $username, 'translate_same_window');
74 <table width
="95%" align
="center" border
="0" cellpadding
="1" cellspacing
="0"><tr
><td bgcolor
="<?php echo $color[0]; ?>">
75 <center
><b
><?php
echo _("Options") . ' - '. _("Translator"); ?
></b
></center
>
78 <?php
if (sqgetGlobalVar('submit_translate',$tmp,SQ_POST
)) {
79 print "<center><h4>"._("Saved Translation Options")."</h4></center>\n";
82 <p
><?php
echo _("Your server options are as follows:"); ?
></p
>
91 echo _("You also decide if you want the translation box displayed, and where it will be located.") .
92 '<form action="'.$PHP_SELF.'" method="post">'.
93 '<table border="0" cellpadding="0" cellspacing="2">'.
94 '<tr><td align="right" nowrap>' .
95 _("Select your translator:") .
97 '<td><select name="translate_translate_server">';
98 translate_showoption();
101 '<tr>'.html_tag('td',_("When reading:"),'right','','nowrap').
102 '<td><input type="checkbox" name="translate_translate_show_read"';
103 if ($translate_show_read)
104 echo ' checked="checked"';
105 echo ' /> - ' . _("Show translation box") .
106 ' <select name="translate_translate_location">';
107 translate_showoption_internal('location', 'left', _("to the left"));
108 translate_showoption_internal('location', 'center', _("in the center"));
109 translate_showoption_internal('location', 'right', _("to the right"));
110 echo '</select><br />'.
111 '<input type="checkbox" name="translate_translate_same_window"';
112 if ($translate_same_window)
113 echo ' checked="checked"';
114 echo ' /> - ' . _("Translate inside the SquirrelMail frames").
117 if (!$disable_compose_translate) {
118 echo '<tr>'.html_tag('td',_("When composing:"),'right','','nowrap').
119 '<td><input type="checkbox" name="translate_translate_show_send"';
120 if ($translate_show_send)
121 echo ' checked="checked"';
122 echo ' /> - ' . _("Not yet functional, currently does nothing") .
127 <input type
="submit" value
="<?php echo _("Submit
"); ?>" name
="submit_translate" />