X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=blobdiff_plain;f=plugins%2Fabook_take%2Fsetup.php;h=73ca0a5adce61e614bd497e9dda6325e17bdaef1;hp=7659d814e0199205bbbfa99031f82ddd4ef33fbd;hb=27663afe63c34d8c329a3f1b09070893c7b25d41;hpb=e8b140ab102cbad01c36685d7e8e2779e0a8ddb4 diff --git a/plugins/abook_take/setup.php b/plugins/abook_take/setup.php index 7659d814..73ca0a5a 100755 --- a/plugins/abook_take/setup.php +++ b/plugins/abook_take/setup.php @@ -1,215 +1,127 @@ ' . $chances[$i] . - // '' . "\n"; - echo "\n"; - $abook_found_email[$chances[$i]] = 1; + $str = substr(strstr($str, $hits[0]), strlen($hits[0])); + if (! isset($abook_found_email[$hits[0]])) + { + echo '\n"; + $abook_found_email[$hits[0]] = 1; + } } - $i ++; - } -} + return; +} function abook_take_read_array($array) { - $i = 0; - while ($i < count($array)) - { - abook_take_read_string($array[$i]); - $i ++; - } + foreach ($array as $item) + abook_take_read_string($item->getAddress()); } - function abook_take_read() { - global $color, $abook_take_location; - global $body, $abook_take_hide, $message, $imapConnection; + global $message; - if ($abook_take_hide) - return; - - ?> -
- - - - -
- - - - -
- header->from); - abook_take_read_array($message->header->cc); - abook_take_read_array($message->header->reply_to); - abook_take_read_array($message->header->to); - - - $new_body = $body; - $pos = strpos($new_body, - '">Download this as a file
'); - if (is_int($pos)) - { - $new_body = substr($new_body, 0, $pos); - } - - $trans = get_html_translation_table(HTML_ENTITIES); - $trans[' '] = ' '; - $trans = array_flip($trans); - $new_body = strtr($new_body, $trans); - - $new_body = urldecode($new_body); - $new_body = strip_tags($new_body); - - $new_body = strtr($new_body, "\n", ' '); - - abook_take_read_string($body); - ?> - -
-
-
-
'."\n"; + + if (isset($message->rfc822_header->reply_to)) + abook_take_read_array($message->rfc822_header->reply_to); + if (isset($message->rfc822_header->from)) + abook_take_read_array($message->rfc822_header->from); + if (isset($message->rfc822_header->cc)) + abook_take_read_array($message->rfc822_header->cc); + if (isset($message->rfc822_header->to)) + abook_take_read_array($message->rfc822_header->to); + + echo '' . + '
'; } function abook_take_pref() { - global $username, $data_dir; - global $abook_take_hide, $abook_take_location, $abook_take_verify; + global $username, $data_dir, $abook_take_verify; - $abook_take_location = getPref($data_dir, $username, 'abook_take_location'); - if ($abook_take_location == '') - $abook_take_location = 'center'; - - $abook_take_hide = getPref($data_dir, $username, 'abook_take_hide'); - $abook_take_verify = getPref($data_dir, $username, 'abook_take_verify'); + $abook_take_verify = getPref($data_dir, $username, 'abook_take_verify'); } - function abook_take_options() { - global $abook_take_location, $abook_take_hide, $abook_take_verify; - - ?>Address Book Take: - on the Read screen
- > Hide the box
- > Try to verify addresses - ' . _("Address Book Take:") . "\n" . + ' ' . _("Try to verify addresses") . "\n"; } function abook_take_save() { - global $username, $data_dir; - global $abook_take_abook_take_location; - global $abook_take_abook_take_hide; - global $abook_take_abook_take_verify; - + global $username, $data_dir; - if (isset($abook_take_abook_take_location)) - { - setPref($data_dir, $username, 'abook_take_location', $abook_take_abook_take_location); - } - else - { - setPref($data_dir, $username, 'abook_take_location', 'center'); - } - - if (isset($abook_take_abook_take_hide)) - { - setPref($data_dir, $username, 'abook_take_hide', '1'); - } - else - { - setPref($data_dir, $username, 'abook_take_hide', ''); - } - - if (isset($abook_take_abook_take_verify)) - { - setPref($data_dir, $username, 'abook_take_verify', '1'); - } - else - { - setPref($data_dir, $username, 'abook_take_verify', ''); - } + if (sqgetGlobalVar('abook_take_abook_take_verify', $abook_take_abook_take_verify, SQ_POST)) + setPref($data_dir, $username, 'abook_take_verify', '1'); + else + setPref($data_dir, $username, 'abook_take_verify', ''); } ?>