From 8b7c37ed0449e5040929843fe2073c76be20b835 Mon Sep 17 00:00:00 2001 From: kink Date: Tue, 27 Feb 2007 18:22:00 +0000 Subject: [PATCH] move HTML output to template, improve HTML on the fly git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@12282 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- plugins/listcommands/mailout.php | 47 ++++--------- .../templates/default/mailout.tpl | 70 +++++++++++++++++++ 2 files changed, 82 insertions(+), 35 deletions(-) create mode 100644 plugins/listcommands/templates/default/mailout.tpl diff --git a/plugins/listcommands/mailout.php b/plugins/listcommands/mailout.php index 89ffe51f..ecba67dc 100644 --- a/plugins/listcommands/mailout.php +++ b/plugins/listcommands/mailout.php @@ -28,7 +28,6 @@ sqgetGlobalVar('body', $body, SQ_GET); sqgetGlobalVar('action', $action, SQ_GET); displayPageHeader($color, $mailbox); -$fieldsdescr = listcommands_fieldsdescr(); switch ( $action ) { case 'help': @@ -47,41 +46,19 @@ switch ( $action ) { exit; } -echo html_tag('p', '', 'left' ) . - html_tag( 'table', '', 'center', $color[0], 'border="0" width="75%"' ) . "\n" . - html_tag( 'tr', - html_tag( 'th', _("Mailinglist") . ': ' . $fieldsdescr[$action], '', $color[9] ) - ) . - html_tag( 'tr' ) . - html_tag( 'td', '', 'left' ); - -printf($out_string, '"' . htmlspecialchars($send_to) . '"'); - -echo addForm(SM_PATH . 'src/compose.php', 'post'); - +$out_string = sprintf($out_string, '"' . htmlspecialchars($send_to) . '"'); $idents = get_identities(); +$fieldsdescr = listcommands_fieldsdescr(); +$fielddescr = $fieldsdescr[$action]; -echo html_tag('p', '', 'center' ) . _("From:") . ' '; +$oTemplate->assign('out_string', $out_string); +$oTemplate->assign('fielddescr', $fielddescr); +$oTemplate->assign('send_to', $send_to); +$oTemplate->assign('subject', $subject); +$oTemplate->assign('body', $body); +$oTemplate->assign('mailbox', $mailbox); +$oTemplate->assign('idents', $idents); -if (count($idents) > 1) { - echo '' . "\n" ; -} else { - echo htmlspecialchars('"'.$idents[0]['full_name'].'" <'.$idents[0]['email_address'].'>'); -} +$oTemplate->display('plugins/listcommands/mailout.tpl'); +$oTemplate->display('footer.tpl'); -echo '
' . - addHidden('send_to', $send_to) . - addHidden('subject', $subject) . - addHidden('body', $body) . - addHidden('mailbox', $mailbox) . - addSubmit(_("Send Mail"), 'send'); -?> -

-

diff --git a/plugins/listcommands/templates/default/mailout.tpl b/plugins/listcommands/templates/default/mailout.tpl new file mode 100644 index 00000000..6b6d2d23 --- /dev/null +++ b/plugins/listcommands/templates/default/mailout.tpl @@ -0,0 +1,70 @@ + + +
+ + + +
+ + +

+ +
+ + 1) { + echo ' '; + echo '\n"; + +} else { + + echo _("From:"); + echo htmlspecialchars($idents[0]['full_name'].' <'.$idents[0]['email_address'].'>'); +} +?> +

+ + + + +" /> +
+
+ +
+
+ -- 2.25.1