CRM-19372 allow payment processors to define an array of accepted credit card types
[civicrm-core.git] / CRM / Core / Resources.php
index 83cb73686e9779d230ca2112c82dbb5127373922..fef18a071ca8229095c824fb04a0199a6d10c1da 100644 (file)
@@ -603,7 +603,7 @@ class CRM_Core_Resources {
         }
       }
 
-      global $tsLocale;
+      $tsLocale = CRM_Core_I18n::getLocale();
       // Dynamic localization script
       $this->addScriptUrl(CRM_Utils_System::url('civicrm/ajax/l10n-js/' . $tsLocale, array('r' => $this->getCacheCode())), $jsWeight++, $region);
 
@@ -753,7 +753,7 @@ class CRM_Core_Resources {
       $items[] = "js/crm.optionEdit.js";
     }
 
-    global $tsLocale;
+    $tsLocale = CRM_Core_I18n::getLocale();
     // Add localized jQuery UI files
     if ($tsLocale && $tsLocale != 'en_US') {
       // Search for i18n file in order of specificity (try fr-CA, then fr)
@@ -788,8 +788,8 @@ class CRM_Core_Resources {
 
   /**
    * Provide a list of available entityRef filters.
-   * FIXME: This function doesn't really belong in this class
-   * @TODO: Provide a sane way to extend this list for other entities - a hook or??
+   * @todo: move component filters into their respective components (e.g. CiviEvent)
+   *
    * @return array
    */
   public static function getEntityRefFilters() {
@@ -834,6 +834,7 @@ class CRM_Core_Resources {
       array('key' => 'country', 'value' => ts('Country'), 'entity' => 'address'),
       array('key' => 'gender_id', 'value' => ts('Gender')),
       array('key' => 'is_deceased', 'value' => ts('Deceased')),
+      array('key' => 'source', 'value' => ts('Contact Source'), 'type' => 'text'),
     );
 
     if (in_array('CiviCase', $config->enableComponents)) {
@@ -856,6 +857,8 @@ class CRM_Core_Resources {
       }
     }
 
+    CRM_Utils_Hook::entityRefFilters($filters);
+
     return $filters;
   }