X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=blobdiff_plain;f=plugins%2Fabook_take%2Fsetup.php;h=e57e63d128a17bf459062f550510217b7637ef56;hp=f14ad2bdd5c1e9284ec8501c7f1223d3dbbf39ac;hb=170883a4a7c0b4c2ba10d9dfb65cc8b9007337d3;hpb=4cf438432a1f2bfdba752e075ec6458ec3e290ba diff --git a/plugins/abook_take/setup.php b/plugins/abook_take/setup.php index f14ad2bd..e57e63d1 100755 --- a/plugins/abook_take/setup.php +++ b/plugins/abook_take/setup.php @@ -1,203 +1,53 @@ \n"; - $abook_found_email[$hits[0]] = 1; - } - } - return; -} - + global $squirrelmail_plugin_hooks; -function abook_take_read_array($array) -{ - $i = 0; - while ($i < count($array)) - { - abook_take_read_string($array[$i]); - $i ++; - } + $squirrelmail_plugin_hooks['read_body_bottom']['abook_take'] = 'abook_take_read_body_bottom'; + $squirrelmail_plugin_hooks['loading_prefs']['abook_take'] = 'abook_take_loading_prefs'; + $squirrelmail_plugin_hooks['options_display_inside']['abook_take'] = 'abook_take_options_display_inside'; + $squirrelmail_plugin_hooks['options_display_save']['abook_take'] = 'abook_take_options_display_save'; } +function abook_take_read_body_bottom() { + include_once(SM_PATH . 'plugins/abook_take/functions.php'); -function abook_take_read() -{ - global $color, $abook_take_location; - global $body, $abook_take_hide, $message, $imapConnection; - - 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 ''; - ?> - - - - - - -
- ' . - '' . - '' . - '' . - ' ' . _("on the Read screen") .'
' . - '' . _("Hide the box") . '
' . - '' . _("Try to verify addresses") . ''; + abook_take_options(); } +function abook_take_options_display_save() { + include_once(SM_PATH . 'plugins/abook_take/functions.php'); -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; - - - 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', ''); - } + abook_take_save(); } - -?>