From: Michael M Slusarz Date: Fri, 26 Jun 2009 22:28:42 +0000 (-0600) Subject: Remove DIMP.conf.msg_index and msg_folder vars X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=cea9df122e8ca73498a8f7a82a8bfa77db07ca59;p=horde.git Remove DIMP.conf.msg_index and msg_folder vars --- diff --git a/imp/ajax.php b/imp/ajax.php index dfaed6e4c..2ac83a8bb 100644 --- a/imp/ajax.php +++ b/imp/ajax.php @@ -475,8 +475,8 @@ case 'ShowPreview': $ptr = each($indices); $args = array( - 'folder' => $ptr['key'], 'index' => intval(reset($ptr['value'])), + 'mailbox' => $ptr['key'], 'preview' => true, ); @@ -541,6 +541,7 @@ case 'DeleteDraft': $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': diff --git a/imp/js/src/DimpBase.js b/imp/js/src/DimpBase.js index 5cde799e9..bcdd47dcb 100644 --- a/imp/js/src/DimpBase.js +++ b/imp/js/src/DimpBase.js @@ -962,7 +962,7 @@ var DimpBase = { 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); @@ -971,7 +971,7 @@ var DimpBase = { if (this.pp && (this.pp.imapuid != r.index || - this.pp.view != r.folder)) { + this.pp.view != r.mailbox)) { return; } @@ -984,16 +984,13 @@ var DimpBase = { } // 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); @@ -1625,10 +1622,14 @@ var DimpBase = { 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')) { diff --git a/imp/js/src/DimpCore.js b/imp/js/src/DimpCore.js index c781f7623..f63c3cff8 100644 --- a/imp/js/src/DimpCore.js +++ b/imp/js/src/DimpCore.js @@ -404,10 +404,6 @@ var DimpCore = { 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; diff --git a/imp/js/src/fullmessage-dimp.js b/imp/js/src/fullmessage-dimp.js index a6a516ea5..9d7956c81 100644 --- a/imp/js/src/fullmessage-dimp.js +++ b/imp/js/src/fullmessage-dimp.js @@ -7,10 +7,12 @@ 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(); @@ -92,14 +94,18 @@ var DimpFullmessage = { 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(); diff --git a/imp/lib/Views/ShowMessage.php b/imp/lib/Views/ShowMessage.php index 11e7eb4dc..93d3eb0f0 100644 --- a/imp/lib/Views/ShowMessage.php +++ b/imp/lib/Views/ShowMessage.php @@ -52,8 +52,8 @@ class IMP_Views_ShowMessage *
      * '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?
      * 
* @@ -67,9 +67,9 @@ class IMP_Views_ShowMessage * '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 * @@ -91,13 +91,13 @@ class IMP_Views_ShowMessage 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. */ diff --git a/imp/lib/base.php b/imp/lib/base.php index 6d51b6ea3..8f626a3cd 100644 --- a/imp/lib/base.php +++ b/imp/lib/base.php @@ -99,7 +99,7 @@ $viewmode = isset($_SESSION['imp']['view']) $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 @@ -129,6 +129,7 @@ if ($authentication !== 'none') { case 'json': $GLOBALS['notification']->push(null, 'dimp.timeout'); Horde::sendHTTPResponse(Horde::prepareResponse(), 'json'); + // Fall through case 'none': exit; @@ -144,9 +145,7 @@ if ($authentication !== 'none') { /* 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')) { diff --git a/imp/message-dimp.php b/imp/message-dimp.php index 7548a0fb4..21069516f 100644 --- a/imp/message-dimp.php +++ b/imp/message-dimp.php @@ -23,8 +23,8 @@ $readonly = $imp_imap->isReadOnly($folder); $args = array( 'headers' => array_diff(array_keys($imp_ui->basicHeaders()), array('subject')), - 'folder' => $folder, 'index' => $index, + 'mailbox' => $folder, 'preview' => false, ); @@ -44,12 +44,8 @@ $scripts = array( 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); }