this.setMessageListTitle();
}.bind(this),
onComplete: function() {
- var row, ssc,
+ var row, ssc, tmp,
l = this.viewport.getMetaData('label');
if (this.uid) {
}
}
}
+
+ /* Read-only changes. 'oa_setflag' is handled
+ * elsewhere. */
+ tmp = [ $('button_deleted') ].compact().invoke('up', 'SPAN');
+ [ 'ctx_message_', 'ctx_draft_' ].each(function(c) {
+ var t = $(c + 'setflag');
+ if (t) {
+ tmp = tmp.concat([ t, t.previous('DIV.sep'), t.next('DIV.sep') ]);
+ }
+ tmp = tmp.concat($(c + 'deleted', c + 'undeleted'));
+ });
+
+ if (this.viewport.getMetaData('readonly')) {
+ tmp.compact().invoke('hide');
+ $('folderName').next().show();
+ } else {
+ tmp.compact().invoke('show');
+ $('folderName').next().hide();
+ }
} else if (this.filtertoggle) {
if (this.filtertoggle == 1 &&
this.viewport.getMetaData('sortby') == DIMP.conf.sortthread) {
break;
case 'ctx_otheractions':
- $('oa_setflag', 'oa_sep1', 'oa_blacklist', 'oa_whitelist', 'oa_sep2', 'oa_undeleted').compact().invoke(this.viewport.getSelected().size() ? 'show' : 'hide');
+ tmp = $('oa_sep1', 'oa_blacklist', 'oa_whitelist', 'oa_sep2', 'oa_undeleted');
+ if (this.viewport.getMetaData('readonly')) {
+ $('oa_setflag').hide().previous('DIV.sep').hide();
+ } else {
+ tmp.push($('oa_setflag'));
+ }
+ tmp.compact().invoke(this.viewport.getSelected().size() ? 'show' : 'hide');
break;
default:
/* Create the base object. */
$result = new stdClass;
$result->id = $mbox;
- $result->reset = false;
+ $result->reset = 0;
$result->totalrows = $msgcount;
$result->label = $label;
$result->cacheid = $imp_mailbox->getCacheID();
if ($GLOBALS['imp_search']->isSearchMbox($mbox)) {
$md->search = 1;
}
+ if ($GLOBALS['imp_imap']->isReadOnly($mbox)) {
+ $md->readonly = 1;
+ }
/* Check for mailbox existence now. If there are no messages, there
* is a chance that the mailbox doesn't exist. If there is at least
}
$imp_ui = new IMP_UI_Message();
+$readonly = $imp_imap->isReadOnly($folder);
$args = array(
'headers' => array_diff(array_keys($imp_ui->basicHeaders()), array('subject')),
$compose_result['js'][] = 'DimpFullmessage.' . $val . ' = ' . Horde_Serialize::serialize($show_msg_result[$val], Horde_Serialize::JSON);
}
}
+
IMP::addInlineScript($compose_result['js']);
IMP::addInlineScript($compose_result['jsonload'], 'load');
IMP::addInlineScript(array(DIMP::notify()), 'dom');
<?php _createDAfmsg(_("Report Innocent"), 'Ham', 'button_ham', '', $show_text) ?>
</span>
<?php endif; ?>
+<?php if (!$readonly): ?>
<span>
<?php _createDAfmsg(_("Delete"), 'Delete', 'button_deleted', '', $show_text) ?>
</span>
+<?php endif; ?>
</div>
</div>