squirrelmail-webmail  1.4.22
About: SquirrelMail is a standards-based webmail package with strong MIME support, address books, and folder manipulation (written in PHP4).
  Fossies Dox: squirrelmail-webmail-1.4.22.tar.gz  ("inofficial" and yet experimental doxygen-generated source code documentation)  

options.php
Go to the documentation of this file.
1 <?php
2 
16 /* Path for SquirrelMail required files. */
17 define('SM_PATH','../../');
18 
19 /* SquirrelMail required files. */
20 require_once(SM_PATH . 'include/validate.php');
21 require_once(SM_PATH . 'functions/strings.php');
22 require_once(SM_PATH . 'functions/page_header.php');
23 require_once(SM_PATH . 'functions/display_messages.php');
24 require_once(SM_PATH . 'include/load_prefs.php');
25 
26 displayPageHeader($color, 'None');
27 
28 if (isset($_POST['submit_translate']) && $_POST['submit_translate'] ) {
29  if (isset($_POST['translate_translate_server'])) {
30  setPref($data_dir, $username, 'translate_server', $_POST['translate_translate_server']);
31  } else {
32  setPref($data_dir, $username, 'translate_server', 'babelfish');
33  }
34 
35  if (isset($_POST['translate_translate_location'])) {
36  setPref($data_dir, $username, 'translate_location', $_POST['translate_translate_location']);
37  } else {
38  setPref($data_dir, $username, 'translate_location', 'center');
39  }
40 
41  if (isset($_POST['translate_translate_show_read'])) {
42  setPref($data_dir, $username, 'translate_show_read', '1');
43  } else {
44  setPref($data_dir, $username, 'translate_show_read', '');
45  }
46 
47  if (isset($_POST['translate_translate_show_send'])) {
48  setPref($data_dir, $username, 'translate_show_send', '1');
49  } else {
50  setPref($data_dir, $username, 'translate_show_send', '');
51  }
52 
53  if (isset($_POST['translate_translate_same_window'])) {
54  setPref($data_dir, $username, 'translate_same_window', '1');
55  } else {
56  setPref($data_dir, $username, 'translate_same_window', '');
57  }
58 }
59 
60 $translate_server = getPref($data_dir, $username, 'translate_server');
61 if ($translate_server == '') {
62  $translate_server = 'babelfish';
63 }
64 $translate_location = getPref($data_dir, $username, 'translate_location');
65 if ($translate_location == '') {
66  $translate_location = 'center';
67 }
68 $translate_show_read = getPref($data_dir, $username, 'translate_show_read');
69 $translate_show_send = getPref($data_dir, $username, 'translate_show_send');
70 $translate_same_window = getPref($data_dir, $username, 'translate_same_window');
71 
72 
73 function ShowOption($Var, $value, $Desc) {
74  $Var = 'translate_' . $Var;
75 
76  global $$Var;
77 
78  echo '<option value="' . $value . '"';
79  if ($$Var == $value) {
80  echo ' selected';
81  }
82  echo '>' . $Desc . "</option>\n";
83 }
84 
85 function ShowTrad( $tit, $com, $url ) {
86  echo "<li><b>$tit</b> - ".
87  $com .
88  "[ <a href=\"$url\" target=\"_blank\">$tit</a> ]</li>";
89 }
90 
91 ?>
92 <table width="95%" align="center" border="0" cellpadding="1" cellspacing="0">
93 <tr><td bgcolor="<?php echo $color[0] ?>">
94 <center><b><?php echo _("Options") . ' - '. _("Translator"); ?></b></center>
95 </td></tr></table>
96 
97 <?php if (isset($_POST['submit_translate']) && $_POST['submit_translate'] ) {
98  print "<center><h4>"._("Saved Translation Options")."</h4></center>\n";
99 }?>
100 
101 <p><?php echo _("Your server options are as follows:"); ?></p>
102 
103 <ul>
104 <?php
105 ShowTrad( 'Babelfish',
106  _("Maximum of 150 words translated, powered by Systran").
107  '<br />'.sprintf(_("Number of supported language pairs: %s"),'36').' ' ,
108  'http://babelfish.altavista.com/' );
115 ShowTrad( 'Dictionary.com',
116  _("No known limits, powered by Systran").
117  '<br />'.sprintf(_("Number of supported language pairs: %s"),'24').' ' ,
118  'http://www.dictionary.com/translate' );
119 ShowTrad( 'InterTran',
120  _("No known limits, powered by Translation Experts' InterTran").
121  '<br />'.sprintf(_("Number of supported languages: %s"),'29').' ' ,
122  'http://www.tranexp.com/' );
131 ShowTrad( 'OTEnet',
132  _("Hellenic translations, no known limits, powered by Systran").
133  '<br />'.sprintf(_("Number of supported language pairs: %s"),'20').' ' ,
134  'http://systran.otenet.gr/' );
135 ShowTrad( 'PROMT',
136  _("Russian translations, maximum of 500 characters translated").
137  '<br />'.sprintf(_("Number of supported language pairs: %s"),'16').' ' ,
138  'http://www.online-translator.com/' );
139 ShowTrad( 'Google Translate',
140  _("No known limits, powered by Systran").
141  '<br />'.sprintf(_("Number of supported language pairs: %s"),'20').' ' ,
142  'http://www.google.com/translate' );
143 ?>
144 </ul>
145 <p>
146 <?php
147 echo _("You also decide if you want the translation box displayed, and where it will be located.") .
148  "<form action=\"$PHP_SELF\" method=\"post\">".
149  '<table border="0" cellpadding="0" cellspacing="2">'.
150  '<tr><td align="right" nowrap>' .
151  _("Select your translator:") .
152  '</td>'.
153  '<td><select name="translate_translate_server">';
154 
155 ShowOption('server', 'babelfish', 'Babelfish');
156 // ShowOption('server', 'go', 'Go.com');
157 ShowOption('server', 'dictionary', 'Dictionary.com');
158 ShowOption('server', 'intertran', 'Intertran');
159 // ShowOption('server', 'gpltrans', 'GPLTrans');
160 ShowOption('server', 'otenet', 'OTEnet');
161 ShowOption('server', 'promt', 'PROMT');
162 ShowOption('server', 'google', 'Google');
163 echo '</select>' .
164  '</td></tr>' .
165  '<tr><td align="right" nowrap>' .
166  _("When reading:") .
167  '</td>'.
168  '<td><input type="checkbox" name="translate_translate_show_read"';
169 if ($translate_show_read) echo " checked";
170 echo ' /> - ' . _("Show translation box") .
171  ' <select name="translate_translate_location">';
172 ShowOption('location', 'left', _("to the left"));
173 ShowOption('location', 'center', _("in the center"));
174 ShowOption('location', 'right', _("to the right"));
175 echo '</select><br>'.
176  '<input type="checkbox" name="translate_translate_same_window"';
177 if ($translate_same_window) echo " checked";
178 echo ' /> - ' . _("Translate inside the SquirrelMail frames").
179  '</td></tr>';
180 // compose option is disabled in stable, because it is not implemented.
181 /*
182  echo '<tr><td align="right" nowrap>'.
183  _("When composing:") . '</td>';
184 echo '<td><input type="checkbox" name="translate_translate_show_send"';
185 if ($translate_show_send)
186  echo " checked";
187  echo ' /> - ' . _("Not yet functional, currently does nothing") .
188  '</td></tr>';
189 */
190 echo '<tr><td></td><td>'.
191  '<input type="submit" value="' . _("Submit") . '" name="submit_translate" />'.
192  '</td></tr>'.
193  '</table>'.
194  '</form>';
195 ?>
196 </body></html>
getPref
getPref($data_dir, $username, $string, $default='')
Definition: db_prefs.php:316
$translate_show_send
$translate_show_send
Definition: options.php:69
SM_PATH
const SM_PATH
Definition: options.php:222
displayPageHeader
displayPageHeader($color, $mailbox, $xtra='', $session=false)
Definition: page_header.php:105
setPref
setPref($data_dir, $username, $string, $set_to)
Definition: db_prefs.php:352
sprintf
powered by Systran sprintf(_("Number of supported language pairs: %s"), '36').' '
Definition: options.php:107
html
Definition: html.class.php:18
$url
$url
Definition: mailto.php:81
$translate_show_read
if($translate_location=='') $translate_show_read
Definition: options.php:68
$translate_location
if($translate_server=='') $translate_location
Definition: options.php:64
ShowOption
ShowOption($Var, $value, $Desc)
Definition: options.php:73
_
_($str)
Definition: gettext.php:160
$translate_same_window
$translate_same_window
Definition: options.php:70
$color
global $color
Definition: options.php:19
$username
global $username
Definition: options.php:225
ShowTrad
ShowTrad( $tit, $com, $url)
Definition: options.php:85
$data_dir
global $data_dir
Definition: options.php:225
$translate_server
if(isset($_POST['submit_translate']) && $_POST['submit_translate']) $translate_server
Definition: options.php:60