X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=plugins%2Fabook_take%2Ffunctions.php;h=ee3414e26fcd8a28b470f89e5590920716a97fd1;hb=2229a3ae504ba005fca71bef2c3111e28050e1b6;hp=536bf18df0d9562cfc3b9172341bf512ae28046f;hpb=91e0dccca7b2452d8b450791cae3aa4125e8889e;p=squirrelmail.git diff --git a/plugins/abook_take/functions.php b/plugins/abook_take/functions.php index 536bf18d..ee3414e2 100644 --- a/plugins/abook_take/functions.php +++ b/plugins/abook_take/functions.php @@ -3,42 +3,36 @@ /** * functions.php * - * Copyright (c) 1999-2004 The SquirrelMail Project Team - * Licensed under the GNU GPL. For full terms see the file COPYING. - * * Functions for the Address Take plugin * - * $Id$ + * @copyright © 1999-2007 The SquirrelMail Project Team + * @license http://opensource.org/licenses/gpl-license.php GNU Public License + * @version $Id$ * @package plugins * @subpackage abook_take */ -/** SquirrelMail required files. */ -require_once(SM_PATH . 'functions/url_parser.php'); -require_once(SM_PATH . 'functions/forms.php'); - -function valid_email ($email, $verify) -{ +/** */ +function valid_email ($email, $verify) { global $Email_RegExp_Match; - if (! eregi('^' . $Email_RegExp_Match . '$', $email)) + if (! eregi('^' . $Email_RegExp_Match . '$', $email)) { return false; + } - if (! $verify) + if (! $verify) { return true; + } return checkdnsrr(substr(strstr($email, '@'), 1), 'ANY') ; } -function abook_take_read_string($str) -{ +function abook_take_read_string($str) { global $abook_found_email, $Email_RegExp_Match; - while (eregi('(' . $Email_RegExp_Match . ')', $str, $hits)) - { + while (eregi('(' . $Email_RegExp_Match . ')', $str, $hits)) { $str = substr(strstr($str, $hits[0]), strlen($hits[0])); - if (! isset($abook_found_email[$hits[0]])) - { + if (! isset($abook_found_email[$hits[0]])) { echo addHidden('email[]', $hits[0]); $abook_found_email[$hits[0]] = 1; } @@ -47,18 +41,16 @@ function abook_take_read_string($str) return; } -function abook_take_read_array($array) -{ +function abook_take_read_array($array) { foreach ($array as $item) abook_take_read_string($item->getAddress()); } -function abook_take_read() -{ +function abook_take_read() { global $message; echo '
' . addForm(SM_PATH . 'plugins/abook_take/take.php') . - '
' . "\n"; + '
' . "\n"; if (isset($message->rfc822_header->reply_to)) abook_take_read_array($message->rfc822_header->reply_to); @@ -70,33 +62,25 @@ function abook_take_read() abook_take_read_array($message->rfc822_header->to); echo addSubmit(_("Take Address")) . - '
'; + ''; } -function abook_take_pref() -{ +function abook_take_pref() { global $username, $data_dir, $abook_take_verify; $abook_take_verify = getPref($data_dir, $username, 'abook_take_verify', false); } -function abook_take_options() -{ - global $abook_take_verify; - - echo '' . html_tag('td',_("Address Book Take:"),'right','','nowrap') . "\n" . '' . - addCheckbox('abook_take_abook_take_verify', $abook_take_verify) . - _("Try to verify addresses") . "\n"; +function abook_take_options() { + global $optpage_data; + + $optpage_data['grps']['abook_take'] = _("Address Book Take"); + $optionValues = array(); + $optionValues[] = array( + 'name' => 'abook_take_verify', + 'caption' => _("Try to verify addresses"), + 'type' => SMOPT_TYPE_BOOLEAN, + 'refresh' => SMOPT_REFRESH_NONE + ); + $optpage_data['vals']['abook_take'] = $optionValues; } - -function abook_take_save() -{ - global $username, $data_dir; - - 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', ''); -} - -?> \ No newline at end of file