summaryrefslogtreecommitdiff
path: root/program/include
diff options
context:
space:
mode:
Diffstat (limited to 'program/include')
-rw-r--r--program/include/rcmail.php25
1 files changed, 25 insertions, 0 deletions
diff --git a/program/include/rcmail.php b/program/include/rcmail.php
index 02287d312..9713cdb4e 100644
--- a/program/include/rcmail.php
+++ b/program/include/rcmail.php
@@ -346,6 +346,31 @@ class rcmail extends rcube
return $list;
}
+ /**
+ * Getter for compose responses.
+ * These are stored in local config and user preferences.
+ *
+ * @param boolean True to sort the list alphabetically
+ * @return array List of the current user's stored responses
+ */
+ public function get_compose_responses($sorted = false)
+ {
+ foreach ($this->config->get('compose_responses', array()) as $response) {
+ if (empty($response['key']))
+ $response['key'] = substr(md5($response['name']), 0, 16);
+ $k = $sorted ? strtolower($response['name']) : $response['key'];
+ $responses[$k] = $response;
+ }
+
+ if ($sorted) {
+ // sort list by name
+ ksort($responses, SORT_LOCALE_STRING);
+ return array_values($responses);
+ }
+
+ return $responses;
+ }
+
/**
* Init output object for GUI and add common scripts.