X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=blobdiff_plain;f=plugins%2Ftranslate%2Foptions.php;h=7e18ef2532ea9abb9fa45e356b74bf88e46f6b20;hp=72503ec453692c4aa53aca8d37d203de018fac5c;hb=75b7d0427336801badc83fecdd4b25da55c6bb81;hpb=df7b27c12af4da5af86c63fccc6b5adf2dbf33ff diff --git a/plugins/translate/options.php b/plugins/translate/options.php index 72503ec4..7e18ef25 100644 --- a/plugins/translate/options.php +++ b/plugins/translate/options.php @@ -3,191 +3,79 @@ /** * options.php * - * Copyright (c) 1999-2003 The SquirrelMail Project Team - * Licensed under the GNU GPL. For full terms see the file COPYING. - * * Pick your translator to translate the body of incoming mail messages * - * $Id$ + * @copyright © 1999-2007 The SquirrelMail Project Team + * @license http://opensource.org/licenses/gpl-license.php GNU Public License + * @version $Id$ * @package plugins * @subpackage translate */ /** - * Path for SquirrelMail required files. - * @ignore + * Include the SquirrelMail initialization file. */ -define('SM_PATH','../../'); - -/* SquirrelMail required files. */ -require_once(SM_PATH . 'include/validate.php'); -require_once(SM_PATH . 'functions/strings.php'); -require_once(SM_PATH . 'functions/page_header.php'); -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', ''); - } - } +require('../../include/init.php'); - $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'); - +/** Plugin functions */ +include_once(SM_PATH . 'plugins/translate/functions.php'); - function ShowOption($Var, $value, $Desc) - { - $Var = 'translate_' . $Var; - - global $$Var; - - echo '\n"; - } - - function ShowTrad( $tit, $com, $url ) { - - echo "
  • $tit - ". - $com . - "[ $tit ]
  • "; - - } +displayPageHeader($color); ?> -
    -
    +
    +
    -

    "._("Saved Translation Options")."

    \n"; - }?> -

      ".sprintf(_("Number of supported language pairs: %s"),"19")." " , - 'http://babelfish.altavista.com/' ); -// ShowTrad( 'Translator.Go.com', -// _("10 language pairs, maximum of 25 kilobytes translated, powered by Systran"), -// 'http://translator.go.com/' ); - ShowTrad( 'Dictionary.com', - _("No known limits, powered by Systran"). - "
      ".sprintf(_("Number of supported language pairs: %s"),"12")." " , - 'http://www.dictionary.com/translate' ); - ShowTrad( 'Google Translate', - _("No known limits, powered by Systran"). - "
      ".sprintf(_("Number of supported language pairs: %s"),"12")." " , - 'http://www.google.com/translate' ); - ShowTrad( 'GPLTrans', - _("No known limits, powered by GPLTrans (free, open source)"). - "
      ".sprintf(_("Number of supported language pairs: %s"),"8")." " , - 'http://www.translator.cx/' ); - ShowTrad( 'InterTran', - _("No known limits, powered by Translation Experts's InterTran"). - "
      ".sprintf(_("Number of supported languages: %s"),"28")." " , - 'http://www.tranexp.com/' ); - ShowTrad( 'OTEnet', - _("Hellenic translations, no known limits, powered by Systran"). - "
      ".sprintf(_("Number of supported language pairs: %s"),"20")." " , - 'http://systran.otenet.gr/' ); - ShowTrad( 'PROMT', - _("Russian translations, maximum of 500 characters translated"). - "
      ".sprintf(_("Number of supported language pairs: %s"),"12")." " , - 'http://www.translate.ru/' ); + translate_showtrad(); ?>

    ". - ''. - '\n"; +} ?> + +
    ' . + '
    '. + '' . + '' . + ''. + ''. '' . - ''.html_tag('td',_("When reading:"),'right','','nowrap'). - ''. - ''.html_tag('td',_("When composing:"),'right','','nowrap'). - '' . + ''.html_tag('td',_("When reading:"),'right','','style="white-space: nowrap;"'). + '\n"; + +if (!$disable_compose_translate) { + echo ''.html_tag('td',_("When composing:"),'right','','style="white-space: nowrap;"'). + ''. - ''. - '
    ' . _("Select your translator:") . '' . - '
    - ' . _("Show translation box") . - '
    '. - ' - ' . _("Translate inside the SquirrelMail frames"). - '
    ' . + '
    - ' . _("Show translation box") . + '
    '. + ' - ' . _("Translate inside the SquirrelMail frames"). + "
    - ' . _("Not yet functional, currently does nothing") . - '
    '. - ''. - '
    '. - '
    '. -"\n"; - + echo ' checked="checked"'; + echo ' /> - ' . _("Not yet functional, currently does nothing") . + "
    +" name="submit_translate" /> +
    + +