$ptr = each($indices);
$args = array(
- 'folder' => $ptr['key'],
'index' => intval(reset($ptr['value'])),
+ 'mailbox' => $ptr['key'],
'preview' => true,
);
$idx_array = array($imp_compose->getMetadata('draft_index') . IMP::IDX_SEP . IMP::folderPref($prefs->getValue('drafts_folder'), true));
$imp_message->delete($idx_array, array('nuke' => true));
}
+ $result = true;
break;
case 'DeleteAttach':
t = $('msgHeadersContent').down('THEAD');
if (!r.error) {
- search = this.viewport.getSelection().search({ imapuid: { equal: [ r.index ] }, view: { equal: [ r.folder ] } });
+ search = this.viewport.getSelection().search({ imapuid: { equal: [ r.index ] }, view: { equal: [ r.mailbox ] } });
if (search.size()) {
row = search.get('dataob').first();
this.updateSeenUID(row, 1);
if (this.pp &&
(this.pp.imapuid != r.index ||
- this.pp.view != r.folder)) {
+ this.pp.view != r.mailbox)) {
return;
}
}
// Store in cache.
- ppuid = this._getPPId(r.index, r.folder);
+ ppuid = this._getPPId(r.index, r.mailbox);
this._expirePPCache([ ppuid ]);
this.ppcache[ppuid] = resp;
this.ppfifo.push(ppuid);
DimpCore.removeAddressLinks(pm);
- DIMP.conf.msg_index = r.index;
- DIMP.conf.msg_folder = r.folder;
-
// Add subject
tmp = pm.select('.subject');
tmp.invoke('update', r.subject === null ? '[' + DIMP.text.badsubject + ']' : r.subject);
case 'msg_newwin':
case 'msg_newwin_options':
- this.msgWindow(this.viewport.getSelection().search({ imapuid: { equal: [ DIMP.conf.msg_index ] } , view: { equal: [ DIMP.conf.msg_folder ] } }).get('dataob').first());
+ this.msgWindow(this.viewport.getSelection().search({ imapuid: { equal: [ this.pp.imapuid ] } , view: { equal: [ this.pp.view ] } }).get('dataob').first());
e.stop();
return;
+ case 'msg_view_source':
+ DimpCore.popupWindow(DimpCore.addURLParam(DIMP.conf.URI_VIEW, { uid: this.pp.imapuid, mailbox: this.pp.view, actionID: 'view_source', id: 0 }, true), DIMP.conf.msg_index + '|' + DIMP.conf.msg_folder);
+ break;
+
case 'applicationfolders':
tmp = e.element();
if (!tmp.hasClassName('custom')) {
window.print();
break;
- case 'msg_view_source':
- this.popupWindow(this.addURLParam(DIMP.conf.URI_VIEW, { uid: DIMP.conf.msg_index, mailbox: DIMP.conf.msg_folder, actionID: 'view_source', id: 0 }, true), DIMP.conf.msg_index + '|' + DIMP.conf.msg_folder);
- break;
-
case 'alertsloglink':
$('alertsloglink').down('A').update(this.Growler.toggleLog() ? DIMP.text.hidealog : DIMP.text.showalog);
break;
var DimpFullmessage = {
+ // Variables defaulting to empty/false:
+ // index, mailbox
quickreply: function(type)
{
var func, ob = {};
- ob[$F('folder')] = [ $F('index') ];
+ ob[this.mailbox] = [ this.index ];
$('msgData').hide();
$('qreply').show();
case 'button_ham':
case 'button_spam':
if (id == 'button_deleted') {
- DIMP.baseWindow.DimpBase.deleteMsg({ index: DIMP.conf.msg_index, mailbox: DIMP.conf.msg_folder });
+ DIMP.baseWindow.DimpBase.deleteMsg({ index: this.index, mailbox: this.mailbox });
} else {
- DIMP.baseWindow.DimpBase.reportSpam(id == 'button_spam', { index: DIMP.conf.msg_index, mailbox: DIMP.conf.msg_folder });
+ DIMP.baseWindow.DimpBase.reportSpam(id == 'button_spam', { index: this.index, mailbox: this.mailbox });
}
window.close();
e.stop();
return;
+ case 'msg_view_source':
+ DimpCore.popupWindow(DimpCore.addURLParam(DIMP.conf.URI_VIEW, { uid: this.index, mailbox: this.mailbox, actionID: 'view_source', id: 0 }, true), DIMP.conf.msg_index + '|' + DIMP.conf.msg_folder);
+ break;
+
case 'qreply':
if (orig.match('DIV.headercloseimg IMG')) {
DimpCompose.confirmCancel();
* <pre>
* 'headers' - The headers desired in the returned headers array (only used
* with non-preview view)
- * 'folder' - The folder name
- * 'index' - The folder index
+ * 'index' - The UID of the message
+ * 'mailbox' - The mailbox name
* 'preview' - Is this the preview view?
* </pre>
*
* 'error' - Contains an error message (only on error)
* 'errortype' - Contains the error type (only on error)
* 'from' - The From addresses
- * 'folder' - The IMAP folder
* 'index' - The IMAP UID
* 'log' - Log information
+ * 'mailbox' - The IMAP mailbox
* 'msgtext' - The text of the message
* 'to' - The To addresses
*
public function showMessage($args)
{
$preview = !empty($args['preview']);
- $mailbox = $args['folder'];
+ $mailbox = $args['mailbox'];
$index = $args['index'];
$error_msg = _("Requested message not found.");
$result = array(
- 'folder' => $mailbox,
- 'index' => $index
+ 'index' => $index,
+ 'mailbox' => $mailbox
);
/* Set the current time zone. */
$authentication = Horde_Util::nonInputVar('authentication', 0);
if ($authentication !== 'none') {
- // If we've gotten to this point and have valid login credentials
+ // If we've reached this point and have valid login credentials
// but don't actually have an IMP session, then we need to go
// through redirect.php to ensure that everything gets set up
// properly. Single-signon and transparent authentication setups
case 'json':
$GLOBALS['notification']->push(null, 'dimp.timeout');
Horde::sendHTTPResponse(Horde::prepareResponse(), 'json');
+ // Fall through
case 'none':
exit;
/* Some stuff that only needs to be initialized if we are
* authenticated. */
// Initialize some message parsing variables.
- if (!empty($GLOBALS['conf']['mailformat']['brokenrfc2231'])) {
- Horde_Mime::$brokenRFC2231 = true;
- }
+ Horde_Mime::$brokenRFC2231 = !empty($GLOBALS['conf']['mailformat']['brokenrfc2231']);
// Set default message character set, if necessary
if ($def_charset = $GLOBALS['prefs']->getValue('default_msg_charset')) {
$args = array(
'headers' => array_diff(array_keys($imp_ui->basicHeaders()), array('subject')),
- 'folder' => $folder,
'index' => $index,
+ 'mailbox' => $folder,
'preview' => false,
);
array('imp.js', 'imp', true)
);
-$js_out = array(
- 'DIMP.conf.msg_index = "' . $show_msg_result['index'] . '"',
- 'DIMP.conf.msg_folder = "' . $show_msg_result['folder'] . '"'
-);
-
-foreach (array('from', 'to', 'cc', 'bcc', 'replyTo', 'log') as $val) {
+$js_out = array();
+foreach (array('from', 'to', 'cc', 'bcc', 'replyTo', 'log', 'index', 'mailbox') as $val) {
if (!empty($show_msg_result[$val])) {
$js_out[] = 'DimpFullmessage.' . $val . ' = ' . Horde_Serialize::serialize($show_msg_result[$val], Horde_Serialize::JSON);
}