X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=blobdiff_plain;f=plugins%2Ftranslate%2Foptions.php;h=d6b999d98e4752aec9a6895594fdfd9715473e7b;hp=ece6cdc55e23b9bb37f899812450cddf396a8bf0;hb=87392775747ce9a3387c3c592fb21b0622cf1fa1;hpb=69ae29f7f14b0198874f6ecec5c7d84fcebb5cd6;ds=sidebyside diff --git a/plugins/translate/options.php b/plugins/translate/options.php index ece6cdc5..d6b999d9 100644 --- a/plugins/translate/options.php +++ b/plugins/translate/options.php @@ -8,7 +8,7 @@ * * Pick your translator to translate the body of incoming mail messages * - * $Id$ + * @version $Id$ * @package plugins * @subpackage translate */ @@ -27,77 +27,82 @@ require_once(SM_PATH . 'functions/display_messages.php'); require_once(SM_PATH . 'functions/imap.php'); require_once(SM_PATH . 'include/load_prefs.php'); - displayPageHeader($color, 'None'); - - if (isset($_POST['submit_translate']) && $_POST['submit_translate'] ) { - if (isset($_POST['translate_translate_server'])) { - setPref($data_dir, $username, 'translate_server', $_POST['translate_translate_server']); - } else { - setPref($data_dir, $username, 'translate_server', 'babelfish'); - } - - if (isset($_POST['translate_translate_location'])) { - setPref($data_dir, $username, 'translate_location', $_POST['translate_translate_location']); - } else { - setPref($data_dir, $username, 'translate_location', 'center'); - } - - if (isset($_POST['translate_translate_show_read'])) { - setPref($data_dir, $username, 'translate_show_read', '1'); - } else { - setPref($data_dir, $username, 'translate_show_read', ''); - } - - if (isset($_POST['translate_translate_show_send'])) { - setPref($data_dir, $username, 'translate_show_send', '1'); - } else { - setPref($data_dir, $username, 'translate_show_send', ''); - } - - if (isset($_POST['translate_translate_same_window'])) { - setPref($data_dir, $username, 'translate_same_window', '1'); - } else { - setPref($data_dir, $username, 'translate_same_window', ''); - } +displayPageHeader($color, 'None'); + +if (isset($_POST['submit_translate']) && $_POST['submit_translate'] ) { + if (isset($_POST['translate_translate_server'])) { + setPref($data_dir, $username, 'translate_server', $_POST['translate_translate_server']); + } else { + setPref($data_dir, $username, 'translate_server', 'babelfish'); } - $translate_server = getPref($data_dir, $username, 'translate_server'); - if ($translate_server == '') { - $translate_server = 'babelfish'; + if (isset($_POST['translate_translate_location'])) { + setPref($data_dir, $username, 'translate_location', $_POST['translate_translate_location']); + } else { + setPref($data_dir, $username, 'translate_location', 'center'); } - $translate_location = getPref($data_dir, $username, 'translate_location'); - if ($translate_location == '') { - $translate_location = 'center'; + + if (isset($_POST['translate_translate_show_read'])) { + setPref($data_dir, $username, 'translate_show_read', '1'); + } else { + setPref($data_dir, $username, 'translate_show_read', ''); } - $translate_show_read = getPref($data_dir, $username, 'translate_show_read'); - $translate_show_send = getPref($data_dir, $username, 'translate_show_send'); - $translate_same_window = getPref($data_dir, $username, 'translate_same_window'); - - function ShowOption($Var, $value, $Desc) - { - $Var = 'translate_' . $Var; + if (isset($_POST['translate_translate_show_send'])) { + setPref($data_dir, $username, 'translate_show_send', '1'); + } else { + setPref($data_dir, $username, 'translate_show_send', ''); + } - global $$Var; + if (isset($_POST['translate_translate_same_window'])) { + setPref($data_dir, $username, 'translate_same_window', '1'); + } else { + setPref($data_dir, $username, 'translate_same_window', ''); + } +} - echo '\n"; +$translate_server = getPref($data_dir, $username, 'translate_server'); +if ($translate_server == '') { + $translate_server = 'babelfish'; +} +$translate_location = getPref($data_dir, $username, 'translate_location'); +if ($translate_location == '') { + $translate_location = 'center'; +} +$translate_show_read = getPref($data_dir, $username, 'translate_show_read'); +$translate_show_send = getPref($data_dir, $username, 'translate_show_send'); +$translate_same_window = getPref($data_dir, $username, 'translate_same_window'); + +/** + * FIXME: undocumented function + * @access private + */ +function ShowOption($Var, $value, $Desc) { + $Var = 'translate_' . $Var; + + global $$Var; + + echo '\n"; +} - function ShowTrad( $tit, $com, $url ) { +/** + * FIXME: undocumented function + * @access private + */ +function ShowTrad( $tit, $com, $url ) { - echo "
  • $tit - ". - $com . - "[ $tit ]
  • "; + echo "
  • $tit - ". + $com . + "[ $tit ]
  • "; - } +} ?> -
    +
    @@ -147,7 +152,7 @@ require_once(SM_PATH . 'include/load_prefs.php'); echo _("You also decide if you want the translation box displayed, and where it will be located.") . "
    ". ''. - ''. '' . ''.html_tag('td',_("When reading:"),'right','','nowrap'). - '\n"; $disable_compose_translate=true; @@ -183,8 +188,8 @@ if (!$disable_compose_translate) { echo ''.html_tag('td',_("When composing:"),'right','','nowrap'). '\n"; } echo '
    ' . + '
    ' . _("Select your translator:") . '' . '
    - ' . _("Show translation box") . + echo " checked"; + echo ' /> - ' . _("Show translation box") . '
    '. - '
    '. + ' - ' . _("Translate inside the SquirrelMail frames"). + echo " checked"; + echo ' /> - ' . _("Translate inside the SquirrelMail frames"). "
    - ' . _("Not yet functional, currently does nothing") . + echo " checked"; + echo ' /> - ' . _("Not yet functional, currently does nothing") . "
    '. @@ -194,4 +199,4 @@ if (!$disable_compose_translate) { ''. "\n"; -?> +?> \ No newline at end of file