class CRM_Core_CommunityMessages

Manage the download, validation, and rendering of community messages

Constants

DEFAULT_MESSAGES_URL

DEFAULT_PERMISSION

DEFAULT_RETRY

Default time to wait before retrying.

Properties

protected CRM_Utils_HttpClient $client
protected CRM_Utils_Cache_Interface $cache
protected FALSE|string $messagesUrl

Methods

create()

Create default instance.

__construct(CRM_Utils_Cache_Interface $cache, CRM_Utils_HttpClient $client, null $messagesUrl = NULL)

No description

NULL|array
getDocument()

Get the messages document (either from the cache or by downloading)

NULL|array
fetchDocument()

Download document from URL and parse as JSON.

FALSE|string
getRenderedUrl()

Get the final, usable URL string (after interpolating any variables)

bool
isEnabled()

No description

NULL|array
pick()

Pick a message to display.

static string
evalMarkup(string $markup)

No description

bool
validateDocument(array $document)

Ensure that a document is well-formed

Details

at line 61
static CRM_Core_CommunityMessages create()

Create default instance.

at line 73
__construct(CRM_Utils_Cache_Interface $cache, CRM_Utils_HttpClient $client, null $messagesUrl = NULL)

Parameters

CRM_Utils_Cache_Interface $cache
CRM_Utils_HttpClient $client
null $messagesUrl

at line 92
NULL|array getDocument()

Get the messages document (either from the cache or by downloading)

Return Value

NULL|array

at line 132
NULL|array fetchDocument()

Download document from URL and parse as JSON.

Return Value

NULL|array parsed JSON

at line 149
FALSE|string getRenderedUrl()

Get the final, usable URL string (after interpolating any variables)

Return Value

FALSE|string

at line 156
bool isEnabled()

Return Value

bool

at line 165
NULL|array pick()

Pick a message to display.

Return Value

NULL|array

at line 197
static string evalMarkup(string $markup)

Parameters

string $markup

Return Value

string

at line 223
bool validateDocument(array $document)

Ensure that a document is well-formed

Parameters

array $document

Return Value

bool