}
}
+/* Add attachment. */
+if ($_SESSION['imp']['file_upload'] &&
+ !$imp_compose->addFilesFromUpload('upload_', $vars->a == _("Expand Names")) &&
+ ($vars->a != _("Expand Names"))) {
+ $vars->a = null;
+}
+
/* Run through the action handlers. */
switch ($vars->a) {
// 'd' = draft
$t->set('hdrs', $hdrs);
$t->set('title', $title);
+/* Activate advanced compose attachments UI? */
+if ($_SESSION['imp']['file_upload']) {
+ try {
+ if (Horde::callHook('mimp_advanced', array('compose_attach'), 'imp')) {
+ $t->set('attach', true);
+ if ($atc_list = $imp_compose->getAttachments()) {
+ $imp_ui_mbox = new IMP_Ui_Mailbox();
+ $t->set('attach_data', sprintf("%s [%s] - %s", htmlspecialchars($atc_list[0]['part']->getName()), htmlspecialchars($atc_list[0]['part']->getType()), $imp_ui_mbox->getSize($atc_list[0]['part']->getBytes())));
+ }
+ }
+ } catch (Horde_Exception_HookNotSet $e) {}
+}
+
require IMP_TEMPLATES . '/common-header.inc';
IMP::status();
echo $t->fetch(IMP_TEMPLATES . '/mimp/compose/compose.html');
// case 'checkbox':
// // Activate the mailbox checkbox interface.
// return true;
+//
+// case 'compose_attach':
+// // Activate the compose attachment interface.
+// return true;
// }
//
// return false;
v5.0-git
--------
-[mms] Add checkbox interface to mailbox page for advanced mobile browsers
- (MIMP).
+[mms] Add ability to add attachments to composed messages for advanced mobile
+ browsers - disabled by default (MIMP).
+[mms] Add checkbox interface to mailbox page for advanced mobile browsers -
+ disabled by default (MIMP).
[mms] Add preference to allow viewing of all inline parts by default (MIMP).
[mms] Add hook to alter composed message details before sending.
[mms] DIMP now honors the 'allow_resume_all' configuration option.
<div><tag:title /></div>
<hr />
- <form action="<tag:url />" method="post">
+ <form action="<tag:url />" method="post" <if:attach><if:attach_data><else:attach_data>enctype="multipart/form-data"</else:attach_data></if:attach_data></if:attach>>
<input type="hidden" name="composeCache" value="<tag:cacheid />" />
<if:redirect>
<input type="hidden" name="action" value="rc" />
<input type="submit" name="a" value="<gettext>Expand Names</gettext>" />
<input type="submit" name="a" value="<gettext>Cancel</gettext>" />
</p>
+<if:attach>
+ <hr />
+ <p>
+ <gettext>Attach</gettext>:
+<if:attach_data>
+ <tag:attach_data />
+<else:attach_data>
+ <input name="upload_1" type="file" />
+</else:attach_data></if:attach_data>
+ </p>
+</if:attach>
</form>
<hr />
<div><gettext>Menu</gettext></div>