X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=plugins%2Ftranslate%2Foptions.php;h=7e18ef2532ea9abb9fa45e356b74bf88e46f6b20;hb=1f8459ebe8c95c2a4e5d3686d0d6e2539a7b8da2;hp=68e25a78dc5677fac16fff0fe0050916cb7dd0af;hpb=d2ab3eac7c46e04e96c5c3c5409aac617729cdcf;p=squirrelmail.git diff --git a/plugins/translate/options.php b/plugins/translate/options.php index 68e25a78..7e18ef25 100644 --- a/plugins/translate/options.php +++ b/plugins/translate/options.php @@ -3,200 +3,79 @@ /** * options.php * - * Copyright (c) 1999-2004 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 * + * @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', ''); - } +require('../../include/init.php'); - if (isset($_POST['translate_translate_same_window'])) { - setPref($data_dir, $username, 'translate_same_window', '1'); - } else { - setPref($data_dir, $username, 'translate_same_window', ''); - } -} - -$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; +/** Plugin functions */ +include_once(SM_PATH . 'plugins/translate/functions.php'); - global $$Var; - - echo '\n"; -} - -/** - * FIXME: undocumented function - * @access private - */ -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"),"24")." " , - '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"),"16")." " , - 'http://www.translator.cx/' ); - ShowTrad( 'InterTran', - _("No known limits, powered by Translation Experts' InterTran"). - "
      ".sprintf(_("Number of supported languages: %s"),"29")." " , - '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"),"13")." " , - 'http://www.online-translator.com/' ); + translate_showtrad(); ?>

    ". - ''. - ' +
    ' . + '
    '. + '' . + '' . + ''. + ''. '' . + ''.html_tag('td',_("When reading:"),'right','','style="white-space: nowrap;"'). + '\n"; - ShowOption('server', 'babelfish', 'Babelfish'); -// ShowOption('server', 'go', 'Go.com'); - ShowOption('server', 'dictionary', 'Dictionary.com'); - ShowOption('server', 'google', 'Google Translate'); - ShowOption('server', 'gpltrans', 'GPLTrans'); - ShowOption('server', 'intertran', 'Intertran'); - ShowOption('server', 'otenet', 'OTEnet'); - ShowOption('server', 'promt', 'PROMT'); - echo '' . - '' . - ''.html_tag('td',_("When reading:"),'right','','nowrap'). - '\n"; - -$disable_compose_translate=true; if (!$disable_compose_translate) { - echo ''.html_tag('td',_("When composing:"),'right','','nowrap'). - '\n"; } - echo ''. - '
    ' . _("Select your translator:") . '' . + '
    - ' . _("Show translation box") . + '
    '. + ' - ' . _("Translate inside the SquirrelMail frames"). + "
    - ' . _("Show translation box") . - '
    '. - ' - ' . _("Translate inside the SquirrelMail frames"). - "
    '.html_tag('td',_("When composing:"),'right','','style="white-space: nowrap;"'). + ' - ' . _("Not yet functional, currently does nothing") . "
    '. - ''. - '
    '. - '
    '. -"\n"; - -?> \ No newline at end of file +?> +
    +" name="submit_translate" /> +
    + +