CRM-16478 Initial changes to remove custom error template path
[civicrm-core.git] / CRM / Utils / Hook.php
index 044457a4701cb960654a5397a7a87148fc84d075..2c12372b18d06dccd55ff2c6e8aadf6013dbd83e 100644 (file)
@@ -81,7 +81,6 @@ abstract class CRM_Utils_Hook {
     if (self::$_singleton == NULL || $fresh) {
       $config = CRM_Core_Config::singleton();
       $class = $config->userHookClass;
-      require_once str_replace('_', DIRECTORY_SEPARATOR, $config->userHookClass) . '.php';
       self::$_singleton = new $class();
     }
     return self::$_singleton;
@@ -384,25 +383,6 @@ abstract class CRM_Utils_Hook {
     );
   }
 
-  /**
-   * This hook is invoked during all CiviCRM form validation. An array of errors
-   * detected is returned. Else we assume validation succeeded.
-   *
-   * @param string $formName
-   *   The name of the form.
-   * @param array &$fields the POST parameters as filtered by QF
-   * @param array &$files the FILES parameters as sent in by POST
-   * @param array &$form the form object
-   *
-   * @return mixed
-   *   formRule hooks return a boolean or
-   *                           an array of error messages which display a QF Error
-   */
-  public static function validate($formName, &$fields, &$files, &$form) {
-    return self::singleton()
-      ->invoke(4, $formName, $fields, $files, $form, self::$_nullObject, self::$_nullObject, 'civicrm_validate');
-  }
-
   /**
    * This hook is invoked during all CiviCRM form validation. An array of errors
    * detected is returned. Else we assume validation succeeded.
@@ -1939,4 +1919,24 @@ abstract class CRM_Utils_Hook {
       ->invoke(1, $messages, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, 'civicrm_check');
   }
 
+  /**
+   * This hook is called when a query string of the CSV Batch export is generated.
+   */
+  public static function batchQuery(&$query) {
+    return self::singleton()->invoke(1, $query, self::$_nullObject,
+      self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject,
+      'civicrm_batchQuery'
+    );
+  }
+
+  /**
+   * This hook is called when the entries of the CSV Batch export are mapped.
+   */
+  public static function batchItems(&$results, &$items) {
+    return self::singleton()->invoke(2, $results, $items,
+      self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject,
+      'civicrm_batchItems'
+    );
+  }
+
 }