v5.0-git
--------
+[mms] Implement stationery support in DIMP.
[mms] Add preference to control displayed content for multipart/alternative
parts (Request #6711).
[mms] Allow multiple messages to be forwarded in a single outgoing message
: l.l;
}
+ /* Stationery switch. */
+ if (id == 's') {
+ DimpCore.doAction('stationery', {
+ html: Number(IMP_Compose_Base.editor_on),
+ id: s,
+ identity: $F('identity'),
+ text: (IMP_Compose_Base.editor_on ? this.rte.getData() : $F('composeMessage'))
+ }, {
+ ajaxopts: { asynchronous: false },
+ callback: function(r) {
+ this.setBodyText(r.response.text);
+ }.bind(this)
+ });
+ return;
+ }
+
$(k.opts.input).setValue(s);
$(k.opts.label).writeAttribute('title', l.escapeHTML()).setText(l.truncate(15)).up(1).show();
this.setPopdownLabel('e', $F('encrypt'));
}
+ /* Create stationery list. */
+ if (DIMP.conf_compose.stationery) {
+ this.createPopdown('s', {
+ base: $('stationery_label').up(),
+ data: DIMP.conf_compose.stationery,
+ label: 'stationery_label'
+ });
+ }
+
// Automatically resize compose address fields.
new TextareaResize('to');
new TextareaResize('cc');
}
/**
+ * AJAX action: Load stationery.
+ *
+ * Variables used:
+ * <pre>
+ * 'html' - (integer) In HTML compose mode?
+ * 'id' - (integer) The stationery entry to use.
+ * 'identity' - (integer) The current identity.
+ * 'text' - (string) The message body text.
+ * </pre>
+ *
+ * @return object An object with the following entries:
+ * <pre>
+ * 'text' - (string) The new message text.
+ * </pre>
+ */
+ public function stationery()
+ {
+ global $injector, $notification, $prefs;
+
+ $identity = $injector->getInstance('IMP_Identity');
+ if (isset($this->_vars->identity) &&
+ !$prefs->isLocked('default_identity')) {
+ $identity->setDefault($this->_vars->identity);
+ }
+ $stationery = $injector->getInstance('IMP_Compose_Stationery');
+
+ $result = new stdClass;
+ $result->text = $stationery->getContent($this->_vars->id, $identity, strval($this->_vars->text), $this->_vars->html);
+
+ $notification->push(sprintf(_("Loaded stationery \"%s\"."), $stationery[$this->_vars->id]['n']), 'horde.message');
+
+ return $result;
+ }
+
+ /**
* AJAX action: Delete a draft.
*
* Variables used:
$t->set('encrypt', IMP::ENCRYPT_NONE);
}
+ $stationery = $GLOBALS['injector']->getInstance('IMP_Compose_Stationery');
+ $t->set('stationery', count($stationery));
+
$select_list = array();
foreach ($identity->getSelectList() as $id => $from) {
$select_list[] = array(
<input id="encrypt" name="encrypt" type="hidden" value="<tag:encrypt />" />
</div>
</if:encrypt>
+<if:stationery>
+ <div>
+ <gettext>Stationery</gettext><span id="stationery_label"></span>
+ </div>
+</if:stationery>
</div>
<table>
}
$code['conf_compose']['encrypt'] = $encrypt;
}
+
+ $stationery = $GLOBALS['injector']->getInstance('IMP_Compose_Stationery');
+ if (count($stationery)) {
+ $slist = array();
+ foreach ($stationery as $key => $val) {
+ $slist[] = array(
+ 'l' => htmlspecialchars($val['n']),
+ 'v' => intval($key)
+ );
+ }
+ $code['conf_compose']['stationery'] = $slist;
+ }
}
Horde::addInlineScript(array(