From 87392775747ce9a3387c3c592fb21b0622cf1fa1 Mon Sep 17 00:00:00 2001 From: tokul Date: Mon, 12 Apr 2004 07:44:45 +0000 Subject: [PATCH] phpdoc blocks and lowercasing html elements git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@7091 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- plugins/translate/index.php | 2 +- plugins/translate/options.php | 145 ++++++++++++++++++---------------- plugins/translate/setup.php | 31 ++++++-- 3 files changed, 100 insertions(+), 78 deletions(-) diff --git a/plugins/translate/index.php b/plugins/translate/index.php index c9c6b07a..4e27ca01 100644 --- a/plugins/translate/index.php +++ b/plugins/translate/index.php @@ -8,7 +8,7 @@ ** ** Redirects to the login page. ** - ** $Id$ + * @version $Id$ * @package plugins * @subpackage translate **/ 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 ' @@ -97,8 +100,8 @@ function translate_table_end() { } /** - * FIXME: - * Undocumented function. + * FIXME: Undocumented function. + * @access private */ function translate_button() { global $translate_show_send; @@ -110,6 +113,7 @@ function translate_button() { /** * Adds translation option block + * @access private */ function translate_optpage_register_block() { global $optpage_blocks; @@ -123,6 +127,7 @@ function translate_optpage_register_block() { /** * Gets user's translation preferences + * @access private */ function translate_pref() { global $username, $data_dir; @@ -148,13 +153,14 @@ function translate_pref() { /** * Tries to select default translation combination - * - * @param string $test language code that has to be tested. - * @returm boolean true if language code matches user's language. * * This function could be speed up. * It basically negates the process if a ! is found in the beginning and * matches a * at the end with 0 or more characters. + * + * @param string $test language code that has to be tested. + * @return boolean true if language code matches user's language. + * @access private */ function translate_does_it_match_language($test) { global $squirrelmail_language; @@ -193,6 +199,8 @@ function translate_does_it_match_language($test) { /** * Creates language option selection box. + * + * @access private */ function translate_lang_opt($from, $to, $value, $text) { global $translate_dir; @@ -216,6 +224,7 @@ function translate_lang_opt($from, $to, $value, $text) { * Starts translation box * * @param string $action url that has to recieve message for translation + * @access private */ function translate_new_form($action) { global $translate_dir, $translate_new_window, $translate_location; @@ -249,6 +258,7 @@ function translate_new_form($action) { * Babelfish translation engine functions * * @param string $message text that has to be translated. + * @access private */ function translate_form_babelfish($message) { translate_new_form('http://babelfish.altavista.com/babelfish/tr'); @@ -306,6 +316,7 @@ function translate_form_babelfish($message) { * go.com translation engine (disabled) * * @param string $message text that has to be translated + * @access private */ function translate_form_go($message) { translate_new_form('http://translator.go.com/cb/trans_entry'); @@ -343,6 +354,7 @@ function translate_form_go($message) { * intertran translation engine * * @param string $message text that has to be translated + * @access private */ function translate_form_intertran($message) { translate_new_form('http://www.tranexp.com:2000/InterTran'); @@ -423,6 +435,7 @@ function translate_form_intertran($message) { * gpltrans translation engine * * @param string $message text that has to be translated + * @access private */ function translate_form_gpltrans($message) { translate_new_form('http://www.translator.cx/cgi-bin/gplTrans'); @@ -449,6 +462,7 @@ function translate_form_gpltrans($message) { * reference.com (dictionary) translation engine * * @param string $message text that has to be translated + * @access private */ function translate_form_dictionary($message) { translate_new_form('http://dictionary.reference.com/translate/text.html'); @@ -515,6 +529,7 @@ function translate_form_dictionary($message) { * otenet translation engine * * @param string $message text that has to be translated + * @access private */ function translate_form_otenet($message) { translate_new_form('http://systran.otenet.gr/cgi-bin/systran.cgi'); @@ -574,6 +589,7 @@ function translate_form_otenet($message) { * promt translation engine * * @param string $message text that has to be translated + * @access private */ function translate_form_promt($message) { translate_new_form('http://www.translate.ru/text.asp#tr_form'); @@ -626,6 +642,7 @@ function translate_form_promt($message) { * google translation engine * * @param string $message text that has to be translated + * @access private */ function translate_form_google($message) { translate_new_form('http://www.google.com/translate_t'); @@ -665,4 +682,4 @@ function translate_form_google($message) { translate_table_end(); } -?> +?> \ No newline at end of file -- 2.25.1
    ' . + '
    ' . _("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 diff --git a/plugins/translate/setup.php b/plugins/translate/setup.php index fcc010a9..344894e5 100644 --- a/plugins/translate/setup.php +++ b/plugins/translate/setup.php @@ -5,7 +5,7 @@ * Copyright (c) 1999-2004 The SquirrelMail Project Team * Licensed under the GNU GPL. For full terms see the file COPYING. * - * $Id$ + * @version $Id$ * @package plugins * @subpackage translate */ @@ -21,6 +21,7 @@ Translation of composed messages is not supported. /** * Initialize the translation plugin * @return void + * @access private */ function squirrelmail_plugin_init_translate() { global $squirrelmail_plugin_hooks; @@ -34,6 +35,7 @@ function squirrelmail_plugin_init_translate() { /** * Shows translation box in message display window + * @access private */ function translate_read_form() { global $color, $translate_server; @@ -84,6 +86,7 @@ if ($trans_ar[0] != '') { /** * Closes table tags in translation box + * @access private */ function translate_table_end() { ?>