var DimpCompose = {
// Variables defaulting to empty/false:
// auto_save_interval, button_pressed, compose_cursor, dbtext,
- // drafts_mbox, editor_on, mp_padding, resizebcc, resizecc, resizeto,
- // row_height, sbtext, skip_spellcheck, spellcheck, uploading
+ // drafts_mbox, editor_on, knl, mp_padding, resizebcc, resizecc,
+ // resizeto, row_height, sbtext, skip_spellcheck, spellcheck, uploading
last_msg: '',
textarea_ready: true,
next = this.get_identity(id),
ssm = $('save_sent_mail');
- $('sent_mail_folder_label').setText(next.id[5]);
+ this.setSentMailLabel(next.id[5]);
$('bcc').setValue(next.id[6]);
if (ssm) {
ssm.writeAttribute('checked', next.id[4]);
}
},
+ setSentMailLabel: function(s)
+ {
+ var label = $('sent_mail_folder_label');
+ if (label) {
+ $('sent_mail_folder_label').writeAttribute('title', s.escapeHTML()).setText('"' + s.truncate(15) + '"');
+ }
+ },
+
get_identity: function(id, editor_on)
{
editor_on = Object.isUndefined(editor_on) ? this.editor_on : editor_on;
fillForm: function(msg, header, focus, noupdate)
{
- // On IE, this can get loaded before DOM;loaded. Check for an init
+ // On IE, this can get loaded before DOM:loaded. Check for an init
// value and don't load until it is available.
if (!this.resizeto) {
this.fillForm.bind(this, msg, header, focus, noupdate).defer();
if (DIMP.conf_compose.cc) {
this.toggleCC('cc');
}
+ this.setSentMailLabel(identity.id[5]);
if (header.bcc) {
$('bcc').setValue(header.bcc);
this.resizebcc.resizeNeeded();
a.down('TD.label SPAN').addClassName('composeAddrbook');
});
}
+
+ /* Create folderlist. */
+ if (DIMP.conf_compose.flist) {
+ this.knl = new KeyNavList('save_sent_mail', {
+ esc: true,
+ list: DIMP.conf_compose.flist,
+ onChoose: this.setSentMailLabel.bind(this)
+ });
+ $('sent_mail_folder_label').insert({ after: new Element('SPAN', { className: 'popdownImg', id: 'compose_flist_popdown' }).observe('click', function(e) { this.knl.show(); e.stop(); }.bindAsEventListener(this)) });
+ }
}
},
/* Load Identity. */
$identity = Identity::singleton(array('imp', 'imp'));
$selected_identity = $identity->getDefault();
- $sent_mail_folder = $identity->getValue('sent_mail_folder');
- if (!empty($sent_mail_folder)) {
- $sent_mail_folder = htmlspecialchars('"' . IMP::displayFolder($sent_mail_folder) . '"');
- }
/* Get user identities. */
$all_sigs = $identity->getAllSignatures();
$result['jsappend'] .= $imp_ui->initRTE('dimp');
}
+ /* Create list for sent-mail selection. */
+ if (!empty($GLOBALS['conf']['user']['select_sentmail_folder']) &&
+ !$GLOBALS['prefs']->isLocked('sent_mail_folder')) {
+ $imp_folder = IMP_Folder::singleton();
+ $flist = array();
+ foreach ($imp_folder->flist() as $val) {
+ $flist[] = array('l' => $val['abbrev'], 'v' => $val['val']);
+ }
+ $result['js'][] = 'DIMP.conf_compose.flist = ' . Horde_Serialize::serialize($flist, Horde_Serialize::JSON);
+ }
+
// Buffer output so that we can return a string from this function
ob_start();
require IMP_TEMPLATES . '/chunks/compose.php';
*
* Variables passed in from calling code:
* $compose_html, $from, $id, $identity, $composeCache, $rte,
- * $selected_identity, $sent_mail_folder
+ * $selected_identity
*
* Copyright 2005-2009 The Horde Project (http://www.horde.org/)
*
<label><input name="request_read_receipt" type="checkbox" class="checkbox"<?php if ($d_read != 'ask') echo ' checked="checked"' ?> /> <?php echo _("Read Receipt") ?></label>
<?php endif; ?>
<?php if ($GLOBALS['conf']['user']['allow_folders'] && !$GLOBALS['prefs']->isLocked('save_sent_mail')): ?>
- <label><input id="save_sent_mail" name="save_sent_mail" type="checkbox" class="checkbox"<?php if ($identity->saveSentmail()) echo ' checked="checked"' ?> /> <?php echo _("Save in ") ?><span id="sent_mail_folder_label"><?php echo $sent_mail_folder ?></span></label>
+ <label><input id="save_sent_mail" name="save_sent_mail" type="checkbox" class="checkbox"<?php if ($identity->saveSentmail()) echo ' checked="checked"' ?> /> <?php echo _("Save in ") ?><span id="sent_mail_folder_label"></span></label>
<?php endif; ?>
</div>
<table cellspacing="0">
left: 0;
}
+#compose_flist_popdown {
+ margin-top: -1px;
+}
+
/* attachment file list */
#attach_list {
padding-top: 5px;
}
/* Images */
-div.msgStatus div, #msgHeadersContent .subject span, span.iconImg, span.contextImg, span.spellcheckPopdownImg, #qsearch_icon, #qsearch_close {
+div.msgStatus div, #msgHeadersContent .subject span, span.iconImg, span.contextImg, span.spellcheckPopdownImg, #qsearch_icon, #qsearch_close, #compose_flist_popdown {
display: -moz-inline-stack;
display: inline-block;
height: 16px;