CRM_Core_CommunityMessages
class CRM_Core_CommunityMessages
Manage the download, validation, and rendering of community messages
Constants
DEFAULT_MESSAGES_URL |
|
DEFAULT_PERMISSION |
|
DEFAULT_RETRY |
|
Properties
protected CRM_Utils_HttpClient | $client | ||
protected CRM_Utils_Cache_Interface | $cache | ||
protected false|string | $messagesUrl | Url to retrieve community messages from. |
Methods
static CRM_Core_CommunityMessages
create()
Create default instance.
__construct(CRM_Utils_Cache_Interface $cache, CRM_Utils_HttpClient $client, string|false $messagesUrl = NULL)
Class constructor.
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 66
static CRM_Core_CommunityMessages
create()
Create default instance.
at line 80
__construct(CRM_Utils_Cache_Interface $cache, CRM_Utils_HttpClient $client, string|false $messagesUrl = NULL)
Class constructor.
at line 99
NULL|array
getDocument()
Get the messages document (either from the cache or by downloading).
at line 140
NULL|array
fetchDocument()
Download document from URL and parse as JSON.
at line 157
FALSE|string
getRenderedUrl()
Get the final, usable URL string (after interpolating any variables)
at line 164
bool
isEnabled()
at line 173
NULL|array
pick()
Pick a message to display.
at line 205
static string
evalMarkup(string $markup)
at line 231
bool
validateDocument(array $document)
Ensure that a document is well-formed