From 72e86d7d9d9cab0ed273214d7fc2291d521127fe Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Wed, 22 Jul 2015 20:19:58 -0400 Subject: [PATCH] CRM-16891 - Add hook_civicrm_coreResourceList --- CRM/Core/Resources.php | 4 ++-- CRM/Utils/Hook.php | 17 +++++++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/CRM/Core/Resources.php b/CRM/Core/Resources.php index 75ca3926f7..3b682b17aa 100644 --- a/CRM/Core/Resources.php +++ b/CRM/Core/Resources.php @@ -749,8 +749,8 @@ class CRM_Core_Resources { } } - // CMS-specific resources - $config->userSystem->appendCoreResources($items); + // Allow hooks to modify this list + CRM_Utils_Hook::coreResourceList($items); return $items; } diff --git a/CRM/Utils/Hook.php b/CRM/Utils/Hook.php index 60c1c088f0..eae92f03d9 100644 --- a/CRM/Utils/Hook.php +++ b/CRM/Utils/Hook.php @@ -1947,4 +1947,21 @@ abstract class CRM_Utils_Hook { ); } + /** + * This hook is called when core resources are being loaded + * + * @see CRM_Core_Resources::coreResourceList + * + * @param array $list + */ + public static function coreResourceList(&$list) { + // First allow the cms integration to add to the list + CRM_Core_Config::singleton()->userSystem->appendCoreResources($list); + + self::singleton()->invoke(1, $list, + self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, + 'civicrm_coreResourceList' + ); + } + } -- 2.25.1