summaryrefslogtreecommitdiff
path: root/program/include
diff options
context:
space:
mode:
authorThomas Bruederli <thomas@roundcube.net>2013-08-29 17:29:18 +0200
committerThomas Bruederli <thomas@roundcube.net>2013-09-04 09:32:01 +0200
commit0ce2126ac91f634b0bc5bf7f3567acd2f87f9972 (patch)
tree96a3b836868b034939442237667349c4613d51e2 /program/include
parent2d6242ffb25b199b569d956b65dec36170026d1e (diff)
New settings section to manage canned responses
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.