X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FCore%2FResources.php;h=195d224063b14f810926b1733e83569a569eed95;hb=39c3fbcda92848d435b973f403d041fff51e4d4e;hp=7436cb682a120cd06d79b7a6cb7b1d043aaf85d9;hpb=43cbbe29eae642e90bc1b98a49d15ab8c415b3e9;p=civicrm-core.git diff --git a/CRM/Core/Resources.php b/CRM/Core/Resources.php index 7436cb682a..195d224063 100644 --- a/CRM/Core/Resources.php +++ b/CRM/Core/Resources.php @@ -3,7 +3,7 @@ +--------------------------------------------------------------------+ | CiviCRM version 5 | +--------------------------------------------------------------------+ - | Copyright CiviCRM LLC (c) 2004-2018 | + | Copyright CiviCRM LLC (c) 2004-2019 | +--------------------------------------------------------------------+ | This file is a part of CiviCRM. | | | @@ -37,7 +37,7 @@ * should incorporte services for aggregation, minimization, etc. * * @package CRM - * @copyright CiviCRM LLC (c) 2004-2018 + * @copyright CiviCRM LLC (c) 2004-2019 * $Id$ * */ @@ -115,13 +115,7 @@ class CRM_Core_Resources { self::$_singleton = $instance; } if (self::$_singleton === NULL) { - $sys = CRM_Extension_System::singleton(); - $cache = Civi::cache('js_strings'); - self::$_singleton = new CRM_Core_Resources( - $sys->getMapper(), - $cache, - CRM_Core_Config::isUpgradeMode() ? NULL : 'resCacheCode' - ); + self::$_singleton = Civi::service('resources'); } return self::$_singleton; } @@ -617,6 +611,10 @@ class CRM_Core_Resources { 'isFrontend' => $config->userFrameworkFrontend, ), ); + $contactID = CRM_Core_Session::getLoggedInContactID(); + if ($contactID) { + $settings['config']['menuCacheCode'] = CRM_Core_BAO_Navigation::getCacheKey($contactID); + } // Disable profile creation if user lacks permission if (!CRM_Core_Permission::check('edit all contacts') && !CRM_Core_Permission::check('add contacts')) { $settings['config']['entityRef']['contactCreate'] = FALSE; @@ -691,6 +689,7 @@ class CRM_Core_Resources { ), 'ajaxPopupsEnabled' => self::singleton()->ajaxPopupsEnabled, 'allowAlertAutodismissal' => (bool) Civi::settings()->get('allow_alert_autodismissal'), + 'resourceCacheCode' => self::singleton()->getCacheCode(), ); print CRM_Core_Smarty::singleton()->fetchWith('CRM/common/l10n.js.tpl', $vars); CRM_Utils_System::civiExit(); @@ -794,7 +793,8 @@ class CRM_Core_Resources { ) { return TRUE; } - return strpos(CRM_Utils_System::getUrlPath(), 'civicrm/ajax') === 0; + $url = CRM_Utils_System::getUrlPath(); + return (strpos($url, 'civicrm/ajax') === 0) || (strpos($url, 'civicrm/angular') === 0); } /**