CoolCMS API

MessageThreadFormTrait

Manual creation of a private conversation in admin — the only place where a thread does not arise from a front end action.

The sender / recipient fields are pickers over users (UserPickerTrait used twice with a different targetField), not selects — the user code list is long.

IMPORTANT: sender and recipient are not thread columns but rows of ..._message_participants. The form only collects them and MessageThreadManager::openThread() turns them into participants.

IMPORTANT: Latte must not render {input senderUserId} — the picker component renders the hidden input itself inside its wrapper, otherwise a duplicate hidden input arises and picker.js writes the id into the wrong one.

Editing a thread deliberately does not exist: changing participants of a running conversation would silently rewrite who sent which messages. A thread is only created and read.

Table of Contents

Methods

createComponentEditForm()  : Form
saveMessageThreadForm()  : bool

Methods

saveMessageThreadForm()

private saveMessageThreadForm(ArrayHash<string|int, mixed> $values) : bool
Parameters
$values : ArrayHash<string|int, mixed>
Return values
bool
On this page

Search results