CRM-19372 allow payment processors to define an array of accepted credit card types
[civicrm-core.git] / CRM / Core / Resources.php
index e835324de0a2efae63140e96294b0eefabc5a3af..fef18a071ca8229095c824fb04a0199a6d10c1da 100644 (file)
@@ -3,7 +3,7 @@
   +--------------------------------------------------------------------+
   | CiviCRM version 4.7                                                |
   +--------------------------------------------------------------------+
-  | Copyright CiviCRM LLC (c) 2004-2015                                |
+  | Copyright CiviCRM LLC (c) 2004-2016                                |
   +--------------------------------------------------------------------+
   | 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-2015
+ * @copyright CiviCRM LLC (c) 2004-2016
  * $Id$
  *
  */
@@ -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;
   }