From e3c1e85bdb39ad5f260ab1a2cff5c8a0a85f4b8f Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Fri, 31 Jul 2015 22:18:42 -0400 Subject: [PATCH] CRM-16891 - Add $region param to hook_civicrm_coreResourceList --- CRM/Core/Resources.php | 7 ++++--- CRM/Utils/Hook.php | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/CRM/Core/Resources.php b/CRM/Core/Resources.php index 3b682b17aa..e1663fc7bf 100644 --- a/CRM/Core/Resources.php +++ b/CRM/Core/Resources.php @@ -587,7 +587,7 @@ class CRM_Core_Resources { // Add resources from coreResourceList $jsWeight = -9999; - foreach ($this->coreResourceList() as $file) { + foreach ($this->coreResourceList($region) as $file) { if (substr($file, -2) == 'js') { // Don't bother looking for ts() calls in packages, there aren't any $translate = (substr($file, 0, 3) == 'js/'); @@ -685,9 +685,10 @@ class CRM_Core_Resources { /** * List of core resources we add to every CiviCRM page. * + * @param string $region * @return array */ - public function coreResourceList() { + public function coreResourceList($region) { $config = CRM_Core_Config::singleton(); // Use minified files for production, uncompressed in debug mode // Note, $this->addScriptFile would automatically search for the non-minified file in debug mode but this is probably faster @@ -750,7 +751,7 @@ class CRM_Core_Resources { } // Allow hooks to modify this list - CRM_Utils_Hook::coreResourceList($items); + CRM_Utils_Hook::coreResourceList($items, $region); return $items; } diff --git a/CRM/Utils/Hook.php b/CRM/Utils/Hook.php index eae92f03d9..2d7dca8563 100644 --- a/CRM/Utils/Hook.php +++ b/CRM/Utils/Hook.php @@ -1953,13 +1953,14 @@ abstract class CRM_Utils_Hook { * @see CRM_Core_Resources::coreResourceList * * @param array $list + * @param string $region */ - public static function coreResourceList(&$list) { + public static function coreResourceList(&$list, $region) { // 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, + self::singleton()->invoke(2, $list, $region, + self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, 'civicrm_coreResourceList' ); } -- 2.25.1