summaryrefslogtreecommitdiff
path: root/program/steps/mail
diff options
context:
space:
mode:
Diffstat (limited to 'program/steps/mail')
-rw-r--r--program/steps/mail/compose.inc36
1 files changed, 35 insertions, 1 deletions
diff --git a/program/steps/mail/compose.inc b/program/steps/mail/compose.inc
index 166a58341..646d2bcd1 100644
--- a/program/steps/mail/compose.inc
+++ b/program/steps/mail/compose.inc
@@ -109,7 +109,8 @@ if (!is_array($COMPOSE))
$OUTPUT->add_label('nosubject', 'nosenderwarning', 'norecipientwarning', 'nosubjectwarning', 'cancel',
'nobodywarning', 'notsentwarning', 'notuploadedwarning', 'savingmessage', 'sendingmessage',
'messagesaved', 'converting', 'editorwarning', 'searching', 'uploading', 'uploadingmany',
- 'fileuploaderror', 'sendmessage');
+ 'fileuploaderror', 'sendmessage', 'savenewresponse', 'responsename', 'responsetext', 'save',
+ 'savingresponse');
$OUTPUT->set_env('compose_id', $COMPOSE['id']);
$OUTPUT->set_pagetitle(rcube_label('compose'));
@@ -1742,6 +1743,38 @@ function compose_file_drop_area($attrib)
}
+/**
+ *
+ */
+function rcmail_compose_responses_list($attrib)
+{
+ global $RCMAIL, $OUTPUT;
+
+ $attrib += array('id' => 'rcmresponseslist', 'tagname' => 'ul', 'cols' => 1);
+
+ $jsenv = array();
+ $list = new html_table($attrib);
+ foreach ($RCMAIL->get_compose_responses(true) as $response) {
+ $key = $response['key'];
+ $item = html::a(array(
+ 'href '=> '#'.urlencode($response['name']),
+ 'class' => rtrim('insertresponse ' . $attrib['itemclass']),
+ 'unselectable' => 'on',
+ 'rel' => $key,
+ ), Q($response['name']));
+
+ $jsenv[$key] = $response;
+ $list->add(array(), $item);
+ }
+
+ // set client env
+ $OUTPUT->set_env('textresponses', $jsenv);
+ $OUTPUT->add_gui_object('responseslist', $attrib['id']);
+
+ return $list->show();
+}
+
+
// register UI objects
$OUTPUT->add_handlers(array(
'composeheaders' => 'rcmail_compose_headers',
@@ -1758,6 +1791,7 @@ $OUTPUT->add_handlers(array(
'storetarget' => 'rcmail_store_target_selection',
'addressbooks' => 'rcmail_addressbook_list',
'addresslist' => 'rcmail_contacts_list',
+ 'responseslist' => 'rcmail_compose_responses_list',
));
$OUTPUT->send('compose');