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