X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=blobdiff_plain;f=plugins%2Ftranslate%2Foptions.php;h=46af6a43f372a3905fd5569dbc13af317b3dd5a4;hp=2288a4441d38f0c75e67cfab5ac70ab10b60e46c;hb=353d074afac6827c90f4bb03e846c5e453d3b5b1;hpb=5c325683cbdd9f91a91ed24078b2ffd1a0bc90ce diff --git a/plugins/translate/options.php b/plugins/translate/options.php index 2288a444..46af6a43 100644 --- a/plugins/translate/options.php +++ b/plugins/translate/options.php @@ -3,169 +3,79 @@ /** * options.php * - * Copyright (c) 1999-2002 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-2018 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. */ -chdir('..'); -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 . 'functions/array.php'); -require_once(SM_PATH . 'functions/i18n.php'); -require_once(SM_PATH . 'include/load_prefs.php'); - - displayPageHeader($color, 'None'); - - if (isset($submit_translate) && $submit_translate ) { - if (isset($translate_translate_server)) { - setPref($data_dir, $username, 'translate_server', $translate_translate_server); - } else { - setPref($data_dir, $username, 'translate_server', 'babelfish'); - } - - if (isset($translate_translate_location)) { - setPref($data_dir, $username, 'translate_location', $translate_translate_location); - } else { - setPref($data_dir, $username, 'translate_location', 'center'); - } - - if (isset($translate_translate_show_read)) { - setPref($data_dir, $username, 'translate_show_read', '1'); - } else { - setPref($data_dir, $username, 'translate_show_read', ''); - } - - if (isset($translate_translate_show_send)) { - setPref($data_dir, $username, 'translate_show_send', '1'); - } else { - setPref($data_dir, $username, 'translate_show_send', ''); - } - - if (isset($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'); - - - function ShowOption($Var, $value, $Desc) - { - $Var = 'translate_' . $Var; - - global $$Var; - - echo '\n"; - } - - function ShowTrad( $tit, $com, $url ) { +/** + * Include the SquirrelMail initialization file. + */ +require('../../include/init.php'); - echo "
  • $tit - ". - $com . - "[ $tit ]
  • "; +/** Plugin functions */ +include_once(SM_PATH . 'plugins/translate/functions.php'); - } +displayPageHeader($color); ?> -
    -
    +
    +

    ". - ''. - '\n"; +} ?> + +
    ' . + '
    '. + '' . + '' . + ''. + ''. '' . - ''. - ''. - ''. - '' . + ''.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:") . '' . - '
    ' . - _("When reading:") . - ' - ' . _("Show translation box") . - '
    '. - ' - ' . _("Translate inside the SquirrelMail frames"). - '
    '. - _("When composing:") . '' . + '
    - ' . _("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" /> +
    + +