class Mention

Class Mention

Constants

private TEMPLATE_HTML

private REGEX_HTML

private REGEX_JSON

Methods

static array
extractMentionedUserIDs(string $htmlString = '')

Get the IDs of the users and users that are members of groups mentioned in the text in either JSON or HTML notation.

static 
sendNotification(string $text, DocumentIndex $reference_document, string|null $customCTAUrl = null)

Send a notification to the users mentioned in the text.

static string|null
transformHTMLToJSON(string $htmlString = '')

Transform HTML mentions generated in WYSIWYG (defining name and id in the data attribute) into @JSON representation, e.g. @{1:UserName} or @{gid_1:Group} .

static string
transformJSONToHTML(string $text = '')

Transform JSON mentions int HTML format which is suitable for the WYSIWYG Editor

static string
transformToLink(string $text)

Transform mentions, defined in HTML or JSON notation to XELOS specific output (user and group links)

static string
transformToNameText(string $text = '')

Transform HTML or JSON mentions in string to text only, e.g. ATname.

Details

at line 131
static array extractMentionedUserIDs(string $htmlString = '')

Get the IDs of the users and users that are members of groups mentioned in the text in either JSON or HTML notation.

Parameters

string $htmlString

Return Value

array

User IDs

at line 170
static sendNotification(string $text, DocumentIndex $reference_document, string|null $customCTAUrl = null)

Send a notification to the users mentioned in the text.

Parameters

string $text

Notifications assume text and not HTML

DocumentIndex $reference_document
string|null $customCTAUrl

Override the default CTA URL for the notification to allow for more parameters

Exceptions

Exception

at line 92
static string|null transformHTMLToJSON(string $htmlString = '')

Transform HTML mentions generated in WYSIWYG (defining name and id in the data attribute) into @JSON representation, e.g. @{1:UserName} or @{gid_1:Group} .

Parameters

string $htmlString

Return Value

string|null @{gid_1:Group}

at line 103
static string transformJSONToHTML(string $text = '')

Transform JSON mentions int HTML format which is suitable for the WYSIWYG Editor

Parameters

string $text

Return Value

string Plugin-HTML

Transform mentions, defined in HTML or JSON notation to XELOS specific output (user and group links)

Parameters

string $text

Return Value

string

at line 118
static string transformToNameText(string $text = '')

Transform HTML or JSON mentions in string to text only, e.g. ATname.

Parameters

string $text

or @}

Return Value

string

@Name or @Group