/* Update maillog information. */
if (!empty($header['in_reply_to']) &&
- !empty($GLOBALS['conf']['maillog']['use_maillog'])) {
- $result->log = array();
- foreach (IMP_Maillog::parseLog($header['in_reply_to']) as $val) {
- $result->log[] = htmlspecialchars($val['msg']);
- }
+ !empty($GLOBALS['conf']['maillog']['use_maillog']) &&
+ ($tmp = DIMP::getMsgLogInfo($header['in_reply_to']))) {
+ $result->log = $tmp;
}
$res = DIMP::getFolderResponse($imptree);
// Add message information
if (r.log) {
- this.updateMsgInfo(r.log);
+ this.updateMsgLog(r.log);
} else {
- $('msgInfo').hide();
+ $('msgLogInfo').hide();
}
$('msgBody').update(r.msgtext);
},
// opts = index, mailbox
- updateMsgInfo: function(log, opts)
+ updateMsgLog: function(log, opts)
{
var tmp;
if (!opts ||
(this.pp.imapuid == opts.index &&
this.pp.view == opts.mailbox)) {
- $('msgInfo').show();
+ $('msgLogInfo').show();
if (opts) {
- $('infolist_col').show();
- $('infolist_exp').hide();
+ $('msgloglist_col').show();
+ $('msgloglist_exp').hide();
}
- DimpCore.updateInfoList(log);
+ DimpCore.updateMsgLog(log);
}
if (opts) {
return elt;
},
- /* Add message info to message view. */
- updateInfoList: function(log)
+ /* Add message log info to message view. */
+ updateMsgLog: function(log)
{
var tmp = '';
log.each(function(entry) {
tmp += '<li><span class="iconImg imp-' + entry.t + '"></span>' + entry.m + '</li>';
});
- $('infolist').down('UL').update(tmp);
+ $('msgloglist').down('UL').update(tmp);
},
/* Removes event handlers from address links. */
});
break;
- case 'infolist_toggle':
- $('infolist_col', 'infolist_exp').invoke('toggle');
- Effect.toggle('infolist', 'blind', {
+ case 'msgloglist_toggle':
+ $('msgloglist_col', 'msgloglist_exp').invoke('toggle');
+ Effect.toggle('msgloglist', 'blind', {
duration: 0.2,
queue: {
position: 'end',
- scope: 'infolist',
+ scope: 'msgloglist',
limit: 2
}
});
}
if (d.log) {
- DIMP.baseWindow.DimpBase.updateMsgInfo(d.log, { index: d.index, mailbox: d.reply_folder });
+ DIMP.baseWindow.DimpBase.updateMsgLog(d.log, { index: d.index, mailbox: d.reply_folder });
}
DIMP.baseWindow.DimpCore.showNotifications(r.msgs);
/* Add message information. */
if (this.log) {
- $('msgInfo').show();
- DimpCore.updateInfoList(this.log);
+ $('msgLogInfo').show();
+ DimpCore.updateMsgLog(this.log);
}
}
return array();
}
+ /**
+ * Build data structure needed by DimpCore javascript to display message
+ * log information.
+ *
+ * @var string $msg_id The Message-ID header of the message.
+ *
+ * @return array An array of information that can be parsed by
+ * DimpCore.updateInfoList().
+ */
+ static public function getMsgLogInfo($msg_id)
+ {
+ $ret = array();
+
+ foreach (IMP_Maillog::parseLog($msg_id) as $val) {
+ $ret[] = array_map('htmlspecialchars', array(
+ 'm' => $val['msg'],
+ 't' => $val['action']
+ ));
+ }
+
+ return $ret;
+ }
+
}
}
/* Grab maillog information. */
- if (!empty($GLOBALS['conf']['maillog']['use_maillog'])) {
- foreach (IMP_Maillog::parseLog($envelope['message-id']) as $val) {
- $result['log'][] = array_map('htmlspecialchars', array(
- 'm' => $val['msg'],
- 't' => $val['action']
- ));
- }
+ if (!empty($GLOBALS['conf']['maillog']['use_maillog']) &&
+ ($tmp = DIMP::getMsgLogInfo($envelope['message-id']))) {
+ $result['log'] = $tmp;
}
if ($preview) {
</td>
</tr>
<?php endif; ?>
- <tr id="msgInfo" style="display:none">
- <td class="label"><a id="infolist_toggle"><span class="iconImg" id="infolist_col"></span><span class="iconImg" id="infolist_exp" style="display:none"></span></a></td>
+ <tr id="msgLogInfo" style="display:none">
+ <td class="label"><a id="msgloglist_toggle"><span class="iconImg" id="msgloglist_col"></span><span class="iconImg" id="msgloglist_exp" style="display:none"></span></a></td>
<td>
- <div><span class="infoLabel"><?php echo _("Message Information") ?></span></div>
- <div id="infolist" style="display:none">
+ <div><span class="msgLogLabel"><?php echo _("Message Log Information") ?></span></div>
+ <div id="msgloglist" style="display:none">
<ul></ul>
</div>
</td>
</div>
</td>
</tr>
- <tr id="msgInfo" style="display:none">
- <td class="label"><a id="infolist_toggle"><span class="iconImg" id="infolist_col"></span><span class="iconImg" id="infolist_exp" style="display:none"></span></a></td>
+ <tr id="msgLogInfo" style="display:none">
+ <td class="label"><a id="msgloglist_toggle"><span class="iconImg" id="msgloglist_col"></span><span class="iconImg" id="msgloglist_exp" style="display:none"></span></a></td>
<td>
- <div><span class="infoLabel"><?php echo _("Message Information") ?></span></div>
- <div id="infolist" style="display:none">
+ <div><span class="msgLogLabel"><?php echo _("Message Log Information") ?></span></div>
+ <div id="msgloglist" style="display:none">
<ul></ul>
</div>
</td>
#msgAtc td {
padding-bottom: 0;
}
-.atcLabel, .infoLabel {
+.atcLabel, .msgLogLabel {
font-weight: bold;
padding-right: 5px;
}
padding-bottom: 2px;
}
-#infolist {
+#msgloglist {
padding-top: 2px;
}
-#infolist ul {
+#msgloglist ul {
list-style-type: none;
}
width: 0;
margin-right: 0;
}
-#th_expand span.iconImg, #partlist_col, #infolist_col {
+#th_expand span.iconImg, #partlist_col, #msgloglist_col {
background-image: url("graphics/arrow_collapsed.png");
}
-#th_collapse span.iconImg, #partlist_exp, #infolist_exp {
+#th_collapse span.iconImg, #partlist_exp, #msgloglist_exp {
background-image: url("graphics/arrow_expanded.png");
}
#msg_view_source span.iconImg {
background-image: url("graphics/search.png");
}
-#th_expand span.iconImg, #partlist_col, #infolist_col {
+#th_expand span.iconImg, #partlist_col, #msgloglist_col {
background-image: url("graphics/arrow_collapsed.png");
}
-#th_collapse span.iconImg, #partlist_exp, #infolist_exp {
+#th_collapse span.iconImg, #partlist_exp, #msgloglist_exp {
background-image: url("graphics/arrow_expanded.png");
}
#msg_view_source span.iconImg {