& to & and 100% to "100%" again
[squirrelmail.git] / plugins / translate / options.php
CommitLineData
849bdf42 1<?php
2 /**
15e6162e 3 * options.php
4 *
5 * Copyright (c) 1999-2002 The SquirrelMail Project Team
6 * Licensed under the GNU GPL. For full terms see the file COPYING.
7 *
8 * Pick your translator to translate the body of incoming mail messages
9 *
10 * $Id$
11 */
849bdf42 12
38a7b6a0 13 chdir('..');
2168398b 14 require_once('../src/validate.php');
e38ebf4d 15 require_once('../functions/strings.php');
16 require_once('../functions/page_header.php');
17 require_once('../functions/display_messages.php');
18 require_once('../functions/imap.php');
19 require_once('../functions/array.php');
20 require_once('../functions/i18n.php');
38a7b6a0 21 require_once('../src/load_prefs.php');
22 displayPageHeader($color, 'None');
849bdf42 23
88cb1b4d 24 if (isset($submit_translate) && $submit_translate ) {
e38ebf4d 25 if (isset($translate_translate_server)) {
26 setPref($data_dir, $username, 'translate_server', $translate_translate_server);
27 } else {
28 setPref($data_dir, $username, 'translate_server', 'babelfish');
29 }
30
31 if (isset($translate_translate_location)) {
32 setPref($data_dir, $username, 'translate_location', $translate_translate_location);
33 } else {
34 setPref($data_dir, $username, 'translate_location', 'center');
35 }
36
37 if (isset($translate_translate_show_read)) {
38 setPref($data_dir, $username, 'translate_show_read', '1');
39 } else {
40 setPref($data_dir, $username, 'translate_show_read', '');
41 }
42
43 if (isset($translate_translate_show_send)) {
44 setPref($data_dir, $username, 'translate_show_send', '1');
45 } else {
46 setPref($data_dir, $username, 'translate_show_send', '');
47 }
48
49 if (isset($translate_translate_same_window)) {
50 setPref($data_dir, $username, 'translate_same_window', '1');
51 } else {
52 setPref($data_dir, $username, 'translate_same_window', '');
53 }
54 }
55
56 $translate_server = getPref($data_dir, $username, 'translate_server');
57 if ($translate_server == '') {
849bdf42 58 $translate_server = 'babelfish';
e38ebf4d 59 }
60 $translate_location = getPref($data_dir, $username, 'translate_location');
61 if ($translate_location == '') {
849bdf42 62 $translate_location = 'center';
e38ebf4d 63 }
64 $translate_show_read = getPref($data_dir, $username, 'translate_show_read');
65 $translate_show_send = getPref($data_dir, $username, 'translate_show_send');
66 $translate_same_window = getPref($data_dir, $username, 'translate_same_window');
67
849bdf42 68
69 function ShowOption($Var, $value, $Desc)
70 {
71 $Var = 'translate_' . $Var;
38a7b6a0 72
849bdf42 73 global $$Var;
38a7b6a0 74
849bdf42 75 echo '<option value="' . $value . '"';
76 if ($$Var == $value)
77 {
78 echo ' SELECTED';
79 }
80 echo '>' . $Desc . "</option>\n";
81 }
38a7b6a0 82
83 function ShowTrad( $tit, $com, $url ) {
84
85 echo "<li><b>$tit</b> - ".
86 $com .
87 "[ <a href=\"$url\" target=\"_blank\">$tit</a> ]</li>";
88
89 }
849bdf42 90
91?>
92 <br>
f6f50b4d 93 <table width="100%" align=center border=0 cellpadding=2 cellspacing=0><tr><td bgcolor="<?php echo $color[0] ?>">
38a7b6a0 94 <center><b><?php echo _("Options") . ' - '. _("Translator"); ?></b></center>
849bdf42 95 </td></tr></table>
96
38a7b6a0 97 <p><?php echo _("Your server options are as follows:"); ?></p>
849bdf42 98
38a7b6a0 99 <ul>
100<?php
101 ShowTrad( 'Babelfish',
102 _("13 language pairs, maximum of 1000 characters translated, powered by Systran"),
103 'http://babelfish.altavista.com/' );
104 ShowTrad( 'Translator.Go.com',
105 _("10 language pairs, maximum of 25 kilobytes translated, powered by Systran"),
106 'http://translator.go.com/' );
107 ShowTrad( 'Dictionary.com',
108 _("12 language pairs, no known limits, powered by Systran"),
109 'http://www.dictionary.com/translate' );
110 ShowTrad( 'InterTran',
111 _("767 language pairs, no known limits, powered by Translation Experts's InterTran"),
112 'http://www.tranexp.com/' );
113 ShowTrad( 'GPLTrans',
114 _("8 language pairs, no known limits, powered by GPLTrans (free, open source)"),
115 'http://www.translator.cx/' );
116?>
849bdf42 117 </ul>
38a7b6a0 118 <p>
119<?php
e38ebf4d 120 echo _("You also decide if you want the translation box displayed, and where it will be located.") .
121 "<form action=\"$PHP_SELF\" method=post>".
122 '<table border=0 cellpadding=0 cellspacing=2>'.
123 '<tr><td align=right nowrap>' .
124 _("Select your translator:") .
125 '</td>'.
126 '<td><select name="translate_translate_server">';
127
849bdf42 128 ShowOption('server', 'babelfish', 'Babelfish');
129 ShowOption('server', 'go', 'Go.com');
130 ShowOption('server', 'dictionary', 'Dictionary.com');
131 ShowOption('server', 'intertran', 'Intertran');
132 ShowOption('server', 'gpltrans', 'GPLTrans');
38a7b6a0 133 echo '</select>' .
134 '</td></tr>' .
135 '<tr><td align=right nowrap>' .
136 _("When reading:") .
137 '</td>'.
138 '<td><input type=checkbox name="translate_translate_show_read"';
139 if ($translate_show_read)
140 echo " CHECKED";
141 echo '> - ' . _("Show translation box") .
142 ' <select name="translate_translate_location">';
143 ShowOption('location', 'left', _("to the left"));
144 ShowOption('location', 'center', _("in the center"));
145 ShowOption('location', 'right', _("to the right"));
146 echo '</select><br>'.
147 '<input type=checkbox name="translate_translate_same_window"';
148 if ($translate_same_window)
149 echo " CHECKED";
150 echo '> - ' . _("Translate inside the SquirrelMail frames").
151 '</td></tr>'.
152 '<tr><td align=right nowrap>'.
153 _("When composing:") . '</td>'.
154 '<td><input type=checkbox name="translate_translate_show_send"';
849bdf42 155 if ($translate_show_send)
156 echo " CHECKED";
38a7b6a0 157 echo '> - ' . _("Not yet functional, currently does nothing") .
158 '</td></tr>'.
159 '<tr><td></td><td>'.
160 '<input type="submit" value="' . _("Submit") . '" name="submit_translate">'.
161 '</td></tr>'.
162 '</table>'.
163 '</form>'.
164"</body></html>\n";
e38ebf4d 165
15e6162e 166?>