X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=blobdiff_plain;f=plugins%2Ftranslate%2Fsetup.php;h=d7445bf43c272c05a2d9c74c92c758fb25f5eee6;hp=33f012e1b4e9a9122b6ebcf70764410172037ddb;hb=e392edc27bed0e613089a824aa7abac5144fce64;hpb=04f6008a45f667d2ce38925f5b2dc4b56076d28e diff --git a/plugins/translate/setup.php b/plugins/translate/setup.php index 33f012e1..d7445bf4 100644 --- a/plugins/translate/setup.php +++ b/plugins/translate/setup.php @@ -1,489 +1,97 @@ Download this as a file
'); - if (is_int($pos)) { - $new_body = substr($new_body, 0, $pos); - } - - $trans = get_html_translation_table('HTMLENTITIES'); - $trans[' '] = ' '; - $trans = array_flip($trans); - $new_body = strtr($new_body, $trans); - - $new_body = urldecode($new_body); - $new_body = strip_tags($new_body); - - /* I really don't like this next part ... */ - $new_body = str_replace('"', "''", $new_body); - $new_body = strtr($new_body, "\n", ' '); - - $function = 'translate_form_' . $translate_server; - $function($new_body); + include_once(SM_PATH . 'plugins/translate/functions.php'); + translate_read_form_function(); } -function translate_table_end() { - ?> - - - - - - - _("Translation Options"), - 'url' => '../plugins/translate/options.php', - 'desc' => _("Which translator should be used when you get messages in a different language?"), - 'js' => false - ); -} - -function translate_pref() { - global $username, $data_dir; - global $translate_server, $translate_location; - global $translate_show_send, $translate_show_read; - global $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_send = getPref($data_dir, $username, 'translate_show_send'); - $translate_show_read = getPref($data_dir, $username, 'translate_show_read'); - $translate_same_window = getPref($data_dir, $username, 'translate_same_window'); + include_once(SM_PATH . 'plugins/translate/functions.php'); + translate_optpage_function(); } - /** - * This function could be sped up. - * It basically negates the process if a ! is found in the beginning and - * matches a * at the end with 0 or more characters. + * Calls user's translation preferences function + * @access private */ -function translate_does_it_match_language($test) { - global $squirrelmail_language; - $true = 1; - $false = 0; - $index = 0; - $smindex = 0; - - if (! $test || ! $squirrelmail_language) { - return $false; - } - - if ($test[$index] == '!') { - $index ++; - $true = 0; - $false = 1; - } - - if (($index == 0) && ($test == $squirrelmail_language)) { - return $true; - } - - while ($test[$index]) { - if ($test[$index] == '*') { - return $true; - } - if ($test[$index] != $squirrelmail_language[$smindex]) { - return $false; - } - $index ++; - $smindex ++; - } - - return $false; +function translate_pref() { + include_once(SM_PATH . 'plugins/translate/functions.php'); + translate_pref_function(); } - -function translate_lang_opt($from, $to, $value, $text) { - global $translate_dir; - - $ret = '