X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Foptions_identities.php;h=12cf4de78ba64f5b27c57c95aa0cc05b360e31dc;hb=ceee04976336b7b26273a1fa979482c4450e7a3d;hp=310f06079af83abcd0b58d37172a60eed2e040d3;hpb=01265fbab60e51c5d97f55cfefe5888abb383ae9;p=squirrelmail.git diff --git a/src/options_identities.php b/src/options_identities.php index 310f0607..12cf4de7 100644 --- a/src/options_identities.php +++ b/src/options_identities.php @@ -3,20 +3,40 @@ /** * options_identities.php * - * Copyright (c) 1999-2002 The SquirrelMail Project Team + * Copyright (c) 1999-2004 The SquirrelMail Project Team * Licensed under the GNU GPL. For full terms see the file COPYING. * * Display Identities Options * - * $Id$ + * @version $Id$ + * @package squirrelmail */ -require_once('../src/validate.php'); -require_once('../functions/display_messages.php'); +/** + * Path for SquirrelMail required files. + * @ignore + */ +define('SM_PATH','../'); + +/* SquirrelMail required files. */ +require_once(SM_PATH . 'include/validate.php'); +require_once(SM_PATH . 'functions/global.php'); +require_once(SM_PATH . 'functions/display_messages.php'); +require_once(SM_PATH . 'functions/html.php'); + +/* POST data var names are dynamic because + of the possible multiple idents so lets get + them all + FIXME! This circumvents the benefits of rg=0 +*/ +if (!empty($_POST)) { + extract($_POST); +} +/* got 'em all */ if (isset($return)) { SaveUpdateFunction(); - header('Location: options_personal.php'); + header('Location: '.get_location().'/options_personal.php'); exit(); } @@ -34,61 +54,46 @@ require_once('../functions/display_messages.php'); SaveUpdateFunction(); } + do_hook('options_identities_top'); LoadInfo($full_name, $email_address, $reply_to, $signature, ''); - -?> -
- - -
- - - - - -
- -

- - - - - - - -
'; + $td_str .= ShowTableInfo($full_name, $email_address, $reply_to, $signature, ''); - $num = 1; - while (LoadInfo($full_name, $email_address, $reply_to, $signature, $num)) - { -?> - - - - - - - - -
-
- -
- -
- - -' . + html_tag( 'table', "\n" . + html_tag( 'tr', "\n" . + html_tag( 'td', "\n" . + ''. _("Options") . ' - ' . _("Advanced Identities") .'
' . + html_tag( 'table', "\n" . + html_tag( 'tr', "\n" . + html_tag( 'td', "\n" . + html_tag( 'table', "\n" . + html_tag( 'tr', "\n" . + html_tag( 'th', _("Default Identity"), 'center', '', 'colspan="2"' ) , + '', $color[9]) . "\n" . + $td_str . "\n" . + html_tag( 'tr', + html_tag( 'th', _("Add a New Identity") . ShowTableInfo('', '', '', '', $num), 'center', '', 'colspan="2"' ) , + '', $color[9]) , + '', '', 'width="80%" cellpadding="2" cellspacing="0" border="0"' ) , + 'center', $color[4] ) + ) , + '', '', 'width="100%" border="0" cellpadding="1" cellspacing="1"' ) , + 'center', $color[0] ) + ) , + 'center', '', 'width="95%" border="0" cellpadding="2" cellspacing="0"' ) . + + ''; function SaveUpdateFunction() { global $username, $data_dir, $full_name, $email_address, $reply_to, $signature; @@ -294,27 +299,25 @@ require_once('../functions/display_messages.php'); } function sti_input( $title, $hd, $data, $post, $bg ) { - - echo "$title:". - ''. - '"; - + $return_val = html_tag( 'tr', + html_tag( 'td', $title . ':', 'right', '', 'nowrap' ) . + html_tag( 'td', '' , 'left' ) , + '', $bg ); + return ($return_val); } function sti_textarea( $title, $hd, $data, $post, $bg ) { - - echo "$title:". - ''. - ""; - + $return_val = html_tag( 'tr', + html_tag( 'td', $title . ':', 'right', '', 'nowrap' ) . + html_tag( 'td', '' , 'left' ) , + '', $bg ); + return ($return_val); } function ShowTableInfo($full_name, $email_address, $reply_to, $signature, $post) { global $color; - $OtherBG = ' bgcolor="' . $color[0] . '"'; + $OtherBG = $color[0]; if ($full_name == '' && $email_address == '' && $reply_to == '' && $signature == '') $OtherBG = ''; @@ -323,29 +326,34 @@ function ShowTableInfo($full_name, $email_address, $reply_to, $signature, $post) else $isEmptySection = false; - sti_input( _("Full Name"), 'full_name', $full_name, $post, $OtherBG ); - sti_input( _("E-Mail Address"), 'email_address', $email_address, $post, $OtherBG ); - sti_input( _("Reply To"), 'reply_to', $reply_to, $post, $OtherBG ); - sti_textarea( _("Signature"), 'signature', $signature, $post, $OtherBG ); - - do_hook('options_identities_table', $OtherBG, $isEmptySection, $post); - echo "". - ' '. - "". - ''; + $return_val = ''; + $return_val .= sti_input( _("Full Name"), 'full_name', $full_name, $post, $OtherBG ); + $return_val .= sti_input( _("E-Mail Address"), 'email_address', $email_address, $post, $OtherBG ); + $return_val .= sti_input( _("Reply To"), 'reply_to', $reply_to, $post, $OtherBG ); + $return_val .= sti_textarea( _("Signature"), 'signature', $signature, $post, $OtherBG ); + + $return_val .= concat_hook_function('options_identities_table', array($OtherBG, $isEmptySection, $post)); + $return_val .= html_tag( 'tr', '', '', $OtherBG); + $return_val .= html_tag( 'td', ' ', 'left' ); + $return_val .= html_tag( 'td', '', 'left' ); + $return_val .= ''; + $return_val .= ''; + + if (! $isEmptySection && $post != '') { - echo "'. - "'; + $return_val .= ''. + ''; } if (! $isEmptySection && $post != '' && $post > 1) { - echo ''; + $return_val .= ''; } - do_hook('options_identities_buttons', $isEmptySection, $post); - echo ''. - ' '; + $return_val .= concat_hook_function('options_identities_buttons', array($isEmptySection, $post)); + $return_val .= ''. + html_tag( 'tr', html_tag( 'td', ' ', 'left', '', 'colspan="2"' )); + + return ($return_val); } ?> \ No newline at end of file