From 26aefb60aa6b0741bc16ab1ac7892a16efb53a25 Mon Sep 17 00:00:00 2001 From: stevetruckstuff Date: Fri, 25 Aug 2006 23:09:07 +0000 Subject: [PATCH] Template for advanced identity controls git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@11644 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- src/options_identities.php | 68 +++++------ .../default/options_advidentity_list.tpl | 115 ++++++++++++++++++ templates/default/stylesheet.tpl | 43 ++++++- 3 files changed, 189 insertions(+), 37 deletions(-) create mode 100644 templates/default/options_advidentity_list.tpl diff --git a/src/options_identities.php b/src/options_identities.php index e6f348d4..792f9a92 100644 --- a/src/options_identities.php +++ b/src/options_identities.php @@ -66,44 +66,42 @@ displayPageHeader($color, 'None'); /* since 1.1.3 */ do_hook('options_identities_top'); -$td_str = ''; -$td_str .= '

' . "\n"; -$td_str .= '' . "\n"; -$cnt = count($identities); -foreach( $identities as $iKey=>$ident ) { - - if ($iKey == 0) { - $hdr_str = _("Default Identity"); - } else { - $hdr_str = sprintf( _("Alternate Identity %d"), $iKey); - } +$i = array(); +foreach ($identities as $key=>$ident) { + $a = array(); + $a['Title'] = $key==0 ? _("Default Identity") : sprintf(_("Alternate Identity %d"), $key); + $a['New'] = false; + $a['Default'] = $key==0; + $a['FullName'] = htmlspecialchars($ident['full_name']); + $a['Email'] = htmlspecialchars($ident['email_address']); + $a['ReplyTo'] = htmlspecialchars($ident['reply_to']); + $a['Signature'] = htmlspecialchars($ident['signature']); + $i[$key] = $a; +} - $td_str .= ShowIdentityInfo( $hdr_str, $ident, $iKey ); +$a = array(); +$a['Title'] = _("Add New Identity"); +$a['New'] = true; +$a['Default'] = false; +$a['FullName'] = ''; +$a['Email'] = ''; +$a['ReplyTo'] = ''; +$a['Signature'] = ''; +$i[count($i)] = $a; -} +echo '' . "\n"; + +$oTemplate->assign('identities', $i); +$oTemplate->display('options_advidentity_list.tpl'); -$td_str .= ShowIdentityInfo( _("Add a New Identity"), array('full_name'=>'','email_address'=>'','reply_to'=>'','signature'=>''), $cnt); -$td_str .= '
' . "\n"; -$td_str .= '
'; - -echo '
' . "\n" . - 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('td', "\n" . $td_str ,'','', 'style="text-align:center;"') - ), - '', '', '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"' ) . ''; +echo "\n"; + +$oTemplate->display('footer.tpl'); + +/** + * The functions below should not be needed with the additions of templates, + * however they will remain in case plugins use them. + */ /** * Returns html formated identity form fields diff --git a/templates/default/options_advidentity_list.tpl b/templates/default/options_advidentity_list.tpl new file mode 100644 index 00000000..cc093810 --- /dev/null +++ b/templates/default/options_advidentity_list.tpl @@ -0,0 +1,115 @@ + +
+ + + + + + + +
+ - +
+ $identity) { + if ($identity['New']) { + ?> +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + +
+ + + +
+ + + +
+ " /> + 0 && !$identity['New']) { + ?> + " /> + " /> + 1 && !$identity['New']) { + ?> + " /> + +
+ +
+
\ No newline at end of file diff --git a/templates/default/stylesheet.tpl b/templates/default/stylesheet.tpl index 4abb8587..dddc4c7f 100644 --- a/templates/default/stylesheet.tpl +++ b/templates/default/stylesheet.tpl @@ -138,6 +138,18 @@ table.table1 td { padding-right: 2px; } +table.table2 { + border: 1px solid ; + width: 80%; + margin-left: auto; + margin-right: auto; +} + +table.table2 td { + padding-left: 2px; + padding-right: 2px; +} + td.emptyList { text-align: center; font-weight: bold; @@ -153,8 +165,8 @@ td.header2 { background: ; text-align: center; font-weight: bold; - padding-top: 4px; - padding-bottom: 4px; + padding-top: 2px; + padding-bottom: 2px; } td.header3 { @@ -695,3 +707,30 @@ tr.odd { margin-left: 10px; } +#optionsIdentity table { + margin-top: 10px; + margin-bottom: 10px; +} + +#optionsIdentity table.table2 tr { + background: ; +} + +#optionsIdentity td.fieldName { + text-align: ; + width: 30%; +} + +#optionsIdentity td.fieldValue { + text-align: ; +} + +#optionsIdentity td.actionButtons { + text-align: center; +} + +#optionsIdentity hr { + width: 95%; + border: 1px solid ; +} + -- 2.25.1