Merge pull request #6371 from colemanw/CRM-16891
authorcolemanw <coleman@civicrm.org>
Sat, 1 Aug 2015 11:58:55 +0000 (07:58 -0400)
committercolemanw <coleman@civicrm.org>
Sat, 1 Aug 2015 11:58:55 +0000 (07:58 -0400)
CRM-16891 - Add $region param to hook_civicrm_coreResourceList

CRM/Core/Resources.php
CRM/Utils/Hook.php

index 3b682b17aa9c65627ebdbb1e31b951a3fd2dd8dd..e1663fc7bf0509c3237b7f3f457ec6bd0c3f75ef 100644 (file)
@@ -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;
   }
index eae92f03d9e645d593263df5aef601faae0c15c4..2d7dca8563e8423a8cf4bbb380620fb0f7dff2c3 100644 (file)
@@ -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'
     );
   }