var DimpCompose = {
// Variables defaulting to empty/false:
// auto_save_interval, button_pressed, compose_cursor, dbtext,
- // drafts_mbox, editor_on, is_popup, knl, mp_padding, resizebcc,
+ // drafts_mbox, editor_on, is_popup, knl_sm, knl_p, mp_padding, resizebcc,
// resizecc, resizeto, row_height, rte, sbtext, skip_spellcheck,
// spellcheck, uploading
last_msg: '',
$('sent_mail_folder_label').writeAttribute('title', l.escapeHTML()).setText(l.truncate(15)).up(1).show();
if (DIMP.conf_compose.flist && sel) {
- this.knl.setSelected(s);
+ this.knl_sm.setSelected(s);
}
},
+ setPriorityLabel: function(s, l)
+ {
+ var label = $('priority_label');
+
+ if (!label) {
+ return;
+ }
+
+ if (!l) {
+ l = DIMP.conf_compose.priority.find(function(f) {
+ return f.v == s;
+ });
+ }
+
+ $('priority').setValue(s);
+ $('priority_label').setText(l.l);
+ },
+
getIdentity: function(id, editor_on)
{
editor_on = Object.isUndefined(editor_on) ? this.editor_on : editor_on;
/* Create folderlist. */
if (DIMP.conf_compose.flist) {
- this.knl = new KeyNavList('save_sent_mail', {
+ this.knl_sm = new KeyNavList('save_sent_mail', {
esc: true,
list: DIMP.conf_compose.flist,
onChoose: this.setSentMailLabel.bind(this)
});
- this.knl.setSelected(this.getIdentity($F('identity'))[3]);
- $('sent_mail_folder_label').insert({ after: new Element('SPAN', { className: 'popdownImg' }).observe('click', function(e) { this.knl.show(); this.knl.ignoreClick(e); e.stop(); }.bindAsEventListener(this)) });
+ this.knl_sm.setSelected(this.getIdentity($F('identity'))[3]);
+ $('sent_mail_folder_label').insert({ after: new Element('SPAN', { className: 'popdownImg' }).observe('click', function(e) { this.knl_sm.show(); this.knl_sm.ignoreClick(e); e.stop(); }.bindAsEventListener(this)) });
+ }
+
+ /* Create priority list. */
+ if (DIMP.conf_compose.priority) {
+ this.knl_p = new KeyNavList('priority_label', {
+ esc: true,
+ list: DIMP.conf_compose.priority,
+ onChoose: this.setPriorityLabel.bind(this)
+ });
+ this.setPriorityLabel('normal');
+ $('priority_label').insert({ after: new Element('SPAN', { className: 'popdownImg' }).observe('click', function(e) { this.knl_p.show(); this.knl_p.ignoreClick(e); e.stop(); }.bindAsEventListener(this)) });
}
$('dimpLoading').hide();
'spellcheck' => intval($GLOBALS['prefs']->getValue('compose_spellcheck')),
));
- if ($GLOBALS['registry']->hasMethod('contacts/search')) {
- $code['conf_compose']['URI_ABOOK'] = (string) Horde::applicationUrl('contacts.php');
- }
-
/* Gettext strings used in compose page. */
$code['text_compose'] = array(
'atc_limit' => _("The attachment limit has been reached."),
'toggle_html' => _("Really discard all formatting information? This operation cannot be undone."),
'uploading' => _("Uploading..."),
);
+
+ if ($GLOBALS['registry']->hasMethod('contacts/search')) {
+ $code['conf_compose']['URI_ABOOK'] = (string) Horde::applicationUrl('contacts.php');
+ }
+
+ if ($GLOBALS['prefs']->getValue('set_priority')) {
+ $code['conf_compose']['priority'] = array(
+ array(
+ 'l' => _("High"),
+ 'v' => 'high'
+ ),
+ array(
+ 'l' => _("Normal"),
+ 's' => true,
+ 'v' => 'normal'
+ ),
+ array(
+ 'l' => _("Low"),
+ 'v' => 'low'
+ )
+ );
+ }
}
Horde::addInlineScript(array(