projects
/
civicrm-core.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge pull request #14313 from AlainBenbassat/issue-981
[civicrm-core.git]
/
CRM
/
Core
/
CommunityMessages.php
diff --git
a/CRM/Core/CommunityMessages.php
b/CRM/Core/CommunityMessages.php
index 7bf3ada503c5b3744e200c9a5dc8e336ab56b201..6d660dc4950fd6042f6c86c308507ab5ad0d4e1c 100644
(file)
--- a/
CRM/Core/CommunityMessages.php
+++ b/
CRM/Core/CommunityMessages.php
@@
-3,7
+3,7
@@
+--------------------------------------------------------------------+
| CiviCRM version 5 |
+--------------------------------------------------------------------+
+--------------------------------------------------------------------+
| CiviCRM version 5 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-201
8
|
+ | Copyright CiviCRM LLC (c) 2004-201
9
|
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
@@
-36,7
+36,8
@@
class CRM_Core_CommunityMessages {
/**
* Default time to wait before retrying.
*/
/**
* Default time to wait before retrying.
*/
- const DEFAULT_RETRY = 7200; // 2 hours
+ // 2 hours
+ const DEFAULT_RETRY = 7200;
/**
* @var CRM_Utils_HttpClient
/**
* @var CRM_Utils_HttpClient
@@
-94,12
+95,13
@@
class CRM_Core_CommunityMessages {
$document = $this->cache->get('communityMessages');
if (empty($document) || !is_array($document)) {
$document = $this->cache->get('communityMessages');
if (empty($document) || !is_array($document)) {
- $document = array(
- 'messages' => array(),
- 'expires' => 0, // ASAP
+ $document = [
+ 'messages' => [],
+ // ASAP
+ 'expires' => 0,
'ttl' => self::DEFAULT_RETRY,
'retry' => self::DEFAULT_RETRY,
'ttl' => self::DEFAULT_RETRY,
'retry' => self::DEFAULT_RETRY,
-
)
;
+
]
;
$isChanged = TRUE;
}
$isChanged = TRUE;
}
@@
-164,10
+166,10
@@
class CRM_Core_CommunityMessages {
*/
public function pick() {
$document = $this->getDocument();
*/
public function pick() {
$document = $this->getDocument();
- $messages =
array()
;
+ $messages =
[]
;
foreach ($document['messages'] as $message) {
if (!isset($message['perms'])) {
foreach ($document['messages'] as $message) {
if (!isset($message['perms'])) {
- $message['perms'] =
array(self::DEFAULT_PERMISSION)
;
+ $message['perms'] =
[self::DEFAULT_PERMISSION]
;
}
if (!CRM_Core_Permission::checkAnyPerm($message['perms'])) {
continue;
}
if (!CRM_Core_Permission::checkAnyPerm($message['perms'])) {
continue;
@@
-196,7
+198,7
@@
class CRM_Core_CommunityMessages {
*/
public static function evalMarkup($markup) {
$config = CRM_Core_Config::singleton();
*/
public static function evalMarkup($markup) {
$config = CRM_Core_Config::singleton();
- $vals =
array(
+ $vals =
[
'resourceUrl' => rtrim($config->resourceBase, '/'),
'ver' => CRM_Utils_System::version(),
'uf' => $config->userFramework,
'resourceUrl' => rtrim($config->resourceBase, '/'),
'ver' => CRM_Utils_System::version(),
'uf' => $config->userFramework,
@@
-205,8
+207,8
@@
class CRM_Core_CommunityMessages {
'baseUrl' => $config->userFrameworkBaseURL,
'lang' => $config->lcMessages,
'co' => $config->defaultContactCountry,
'baseUrl' => $config->userFrameworkBaseURL,
'lang' => $config->lcMessages,
'co' => $config->defaultContactCountry,
-
)
;
- $vars =
array()
;
+
]
;
+ $vars =
[]
;
foreach ($vals as $k => $v) {
$vars['%%' . $k . '%%'] = $v;
$vars['{{' . $k . '}}'] = urlencode($v);
foreach ($vals as $k => $v) {
$vars['%%' . $k . '%%'] = $v;
$vars['{{' . $k . '}}'] = urlencode($v);