Fixed login crash
[squirrelmail.git] / plugins / translate / options.php
1 <?php
2 /**
3 ** options.php
4 **
5 ** Pick your translator to translate the body of incoming mail messages
6 **
7 **/
8
9 chdir('..');
10
11 session_start();
12
13 if (!isset($config_php))
14 include_once('../config/config.php');
15 if (!isset($strings_php))
16 include_once('../functions/strings.php');
17 if (!isset($page_header_php))
18 include_once('../functions/page_header.php');
19 if (!isset($display_messages_php))
20 include_once('../functions/display_messages.php');
21 if (!isset($imap_php))
22 include_once('../functions/imap.php');
23 if (!isset($array_php))
24 include_once('../functions/array.php');
25 if (!isset($i18n_php))
26 include_once('../functions/i18n.php');
27
28
29 require_once('../src/load_prefs.php');
30 displayPageHeader($color, 'None');
31
32 $translate_server = getPref($data_dir, $username, 'translate_server');
33 if ($translate_server == '')
34 $translate_server = 'babelfish';
35 $translate_location = getPref($data_dir, $username, 'translate_location');
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;
45
46 global $$Var;
47
48 echo '<option value="' . $value . '"';
49 if ($$Var == $value)
50 {
51 echo ' SELECTED';
52 }
53 echo '>' . $Desc . "</option>\n";
54 }
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 }
63
64 ?>
65 <br>
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>
68 </td></tr></table>
69
70 <p><?php echo _("Your server options are as follows:"); ?></p>
71
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 ?>
90 </ul>
91 <p>
92 <?php
93 echo _("You also decide if you want the translation box displayed, and where it will be located.");
94 ?></p>
95
96 <form action="../../src/options.php" method=post>
97 <table border=0 cellpadding=0 cellspacing=2>
98 <tr><td align=right nowrap><?php echo _("Select your translator:"); ?></td>
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');
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"';
128 if ($translate_show_send)
129 echo " CHECKED";
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";