X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=blobdiff_plain;f=plugins%2Fabook_take%2Fsetup.php;h=73ca0a5adce61e614bd497e9dda6325e17bdaef1;hp=2f45a70470b0225001cc47897b65eaa0a0043a37;hb=ea5f4b8eaf805c4cc4e9533e87d057300a7fe666;hpb=2798d75769082b5c3b74d9c52a9606f3c0a09fc6 diff --git a/plugins/abook_take/setup.php b/plugins/abook_take/setup.php index 2f45a704..73ca0a5a 100755 --- a/plugins/abook_take/setup.php +++ b/plugins/abook_take/setup.php @@ -1,203 +1,127 @@ \n"; + $abook_found_email[$hits[0]] = 1; + } + } - while (eregi('(' . $Email_RegExp_Match . ')', $str, $hits)) - { - $str = substr(strstr($str, $hits[0]), strlen($hits[0])); - if (! isset($abook_found_email[$hits[0]])) - { - echo "\n"; - $abook_found_email[$hits[0]] = 1; - } - } - return; + 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; - - echo '
' . "\n" . - html_tag( 'table', '', $abook_take_location, $color[10], 'cellpadding="3" cellspacing="0" border="0"' ) . - html_tag( 'tr' ) . - html_tag( 'td', '', 'left' ) . - html_tag( 'table', '', '', $color[5], 'cellpadding="2" cellspacing="1" border="0"' ) . - html_tag( 'tr' ) . - html_tag( 'td' ); - - abook_take_read_string($message->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); - - echo ''; - ?> - - - - - - -
-
'."\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; - - echo html_tag( 'tr' ) . - html_tag( 'td', _("Address Book Take") . ':', 'right', '', 'nowrap valign="top"' ) . - html_tag( 'td', '', 'left' ) . - ' ' . _("on the Read screen") .'
' . - ' ' . _("Hide the box") . '
' . - ' ' . _("Try to verify addresses") . ''; + global $abook_take_verify; + + echo '' . _("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', ''); } ?>