/* since 1.1.3 */
do_hook('options_identities_top');
-$td_str = '';
-$td_str .= '<form name="f" action="options_identities.php" method="post"><br />' . "\n";
-$td_str .= '<table border="0" cellspacing="0" cellpadding="0" width="100%">' . "\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 '<form name="f" action="options_identities.php" method="post">' . "\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 .= '</table>' . "\n";
-$td_str .= '</form>';
-
-echo '<br /> ' . "\n" .
- html_tag('table', "\n" .
- html_tag('tr', "\n" .
- html_tag('td' , "\n" .
- '<b>' . _("Options") . ' - ' . _("Advanced Identities") . '</b><br />' .
- 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"' ) . '</body></html>';
+echo "</form>\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
--- /dev/null
+<?php
+/**
+ * options_ident_advanced.tpl
+ *
+ * Template to handle advanced identity management
+ *
+ * The following variables are available in this template:
+ * $identities - array containing all identities. Each element contains
+ * the following fields:
+ * $el['Title'] - title to be displayed in each block
+ * $el['New'] - boolean TRUE if this element is for a new identity.
+ * FALSE otherwise.
+ * $el['Default'] - boolean TRUE if this is the default identity.
+ * $el['FullName'] - value for the Full Name field
+ * $el['Email'] - value for the email field
+ * $el['ReplyTo'] - value for the Reply To field
+ * $el['Signature']- value for the Signature field
+ *
+ * @copyright © 1999-2006 The SquirrelMail Project Team
+ * @license http://opensource.org/licenses/gpl-license.php GNU Public License
+ * @version $Id$
+ * @package squirrelmail
+ * @subpackage templates
+ */
+
+/** add required includes **/
+
+/** extract template variables **/
+extract($t);
+
+/** Begin template **/
+?>
+<div id="optionsIdentity">
+<table cellspacing="0" class="table1">
+ <tr>
+ <td class="header1">
+ <?php echo _("Options"); ?> - <?php echo _("Advanced Identities"); ?>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <?php
+ foreach ($identities as $index=>$identity) {
+ if ($identity['New']) {
+ ?>
+ <hr />
+ <?php
+ }
+ ?>
+ <table cellspacing="0" class="table2">
+ <tr>
+ <td colspan="2" class="header2">
+ <?php echo $identity['Title']; ?>
+ </td>
+ </tr>
+ <tr>
+ <td class="fieldName">
+ <?php echo _("Full Name"); ?>
+ </td>
+ <td class="fieldValue">
+ <input type="text" name="newidentities[<?php echo $index; ?>][full_name]" size="50" value="<?php echo $identity['FullName']; ?>" />
+ </td>
+ </tr>
+ <tr>
+ <td class="fieldName">
+ <?php echo _("E-Mail Address"); ?>
+ </td>
+ <td class="fieldValue">
+ <input type="text" name="newidentities[<?php echo $index; ?>][email_address]" size="50" value="<?php echo $identity['Email']; ?>" />
+ </td>
+ </tr>
+ <tr>
+ <td class="fieldName">
+ <?php echo _("Reply To"); ?>
+ </td>
+ <td class="fieldValue">
+ <input type="text" name="newidentities[<?php echo $index; ?>][reply_to]" size="50" value="<?php echo $identity['ReplyTo']; ?>" />
+ </td>
+ </tr>
+ <tr>
+ <td class="fieldName">
+ <?php echo _("Signature"); ?>
+ </td>
+ <td class="fieldValue">
+ <textarea name="newidentities[<?php echo $index; ?>][signature]" cols="50" rows="5"><?php echo $identity['Signature']; ?></textarea>
+ </td>
+ </tr>
+ <?php echo concat_hook_function('options_identities_table', array('', $identity['New'], $index)); ?>
+ <tr>
+ <td colspan="2" class="actionButtons">
+ <input type="submit" name="smaction[save][<?php echo $index; ?>]" value="<?php echo _("Save / Update"); ?>" />
+ <?php
+ if ($index > 0 && !$identity['New']) {
+ ?>
+ <input type="submit" name="smaction[makedefault][<?php echo $index; ?>]" value="<?php echo _("Make Default"); ?>" />
+ <input type="submit" name="smaction[delete][<?php echo $index; ?>]" value="<?php echo _("Delete"); ?>" />
+ <?php
+ }
+ if ($index > 1 && !$identity['New']) {
+ ?>
+ <input type="submit" name="smaction[move][<?php echo $index; ?>]" value="<?php echo _("Move Up"); ?>" />
+ <?php
+ }
+ echo concat_hook_function('options_identities_buttons', array($identity['New'], $index));
+ ?>
+ </td>
+ </tr>
+ </table>
+ <?php
+ }
+ ?>
+ </td>
+ </tr>
+</table>
+</div>
\ No newline at end of file
padding-right: 2px;
}
+table.table2 {
+ border: 1px solid <?php echo $color[9]; ?>;
+ 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;
background: <?php echo $color[9]; ?>;
text-align: center;
font-weight: bold;
- padding-top: 4px;
- padding-bottom: 4px;
+ padding-top: 2px;
+ padding-bottom: 2px;
}
td.header3 {
margin-left: 10px;
}
+#optionsIdentity table {
+ margin-top: 10px;
+ margin-bottom: 10px;
+}
+
+#optionsIdentity table.table2 tr {
+ background: <?php echo $color[0]; ?>;
+}
+
+#optionsIdentity td.fieldName {
+ text-align: <?php echo SQM_ALIGN_RIGHT; ?>;
+ width: 30%;
+}
+
+#optionsIdentity td.fieldValue {
+ text-align: <?php echo SQM_ALIGN_LEFT; ?>;
+}
+
+#optionsIdentity td.actionButtons {
+ text-align: center;
+}
+
+#optionsIdentity hr {
+ width: 95%;
+ border: 1px solid <?php echo $color[9]; ?>;
+}
+