X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FUtils%2FHook.php;h=bed5f0dfcdf5a2240b7396dc31d751759bd0a00c;hb=e95b216ad573940d202b4804cea2ceb6718c5a54;hp=85f7e9b859b046d938c02abc3ad5b4cdd3572df1;hpb=fc22a71f4af84505bebc7c9760419de350c72b2a;p=civicrm-core.git diff --git a/CRM/Utils/Hook.php b/CRM/Utils/Hook.php index 85f7e9b859..bed5f0dfcd 100644 --- a/CRM/Utils/Hook.php +++ b/CRM/Utils/Hook.php @@ -1,7 +1,7 @@ invoke(5, $op, $mailingId, $contactId, $groups, $baseGroups, 'civicrm_unsubscribeGroups'); @@ -748,6 +751,16 @@ abstract class CRM_Utils_Hook { ); } + /** + * This hook is called when locating CiviCase types. + * + * @param array $caseTypes + * @return void + */ + static function caseTypes(&$caseTypes) { + return self::singleton()->invoke(1, $caseTypes, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, 'civicrm_caseTypes'); + } + /** * This hook is called soon after the CRM_Core_Config object has ben initialized. * You can use this hook to modify the config object and hence behavior of CiviCRM dynamically. @@ -1056,6 +1069,23 @@ abstract class CRM_Utils_Hook { ); } + /** + * This hooks allows alteration of the tpl file used to generate content. It differs from the + * altercontent hook as the content has already been rendered through the tpl at that point + * + * @param $formName previously generated content + * @param $form reference to the form object + * @param $context context of content - page or form + * @param $tplName reference the file name of the tpl + * + * @access public + */ + static function alterTemplateFile($formName, &$form, $context, &$tplName) { + return self::singleton()->invoke(4, $formName, $form, $context, $tplName, + self::$_nullObject, + 'civicrm_alterTemplateFile' + ); + } /** * This hook collects the trigger definition from all components * @@ -1198,6 +1228,21 @@ abstract class CRM_Utils_Hook { ); } + /** + * This hook is called before running an api call. + * + * @param $wrappers array of implements API_Wrapper(see CRM/Utils/API/ReloadOption.php as an example) + * + * @return null the return value is ignored + * @access public + */ + static function apiWrappers(&$wrappers, $apiRequest) { + return self::singleton() + ->invoke(2, $wrappers, $apiRequest, self::$_nullObject, self::$_nullObject, self::$_nullObject, + 'civicrm_apiWrappers' + ); + } + /** * This hook is called before running pending cron jobs. * @@ -1317,6 +1362,22 @@ abstract class CRM_Utils_Hook { self::$_nullObject, 'civicrm_alterBarcode'); } + /** + * Modify or replace the Mailer object used for outgoing mail. + * + * @param object $mailer + * The default mailer produced by normal configuration; a PEAR "Mail" class (like those returned by Mail::factory) + * @param string $driver + * The type of the default mailer (eg "smtp", "sendmail", "mock", "CRM_Mailing_BAO_Spool") + * @param array $params + * The default mailer config options + * @see Mail::factory + */ + static function alterMail(&$mailer, $driver, $params) { + return self::singleton() + ->invoke(3, $mailer, $driver, $params, self::$_nullObject, self::$_nullObject, 'civicrm_alterMailer'); + } + /** * This hook is called while building the core search query, * so hook implementers can provide their own query objects which alters/extends core search. @@ -1324,7 +1385,17 @@ abstract class CRM_Utils_Hook { * @param Array $queryObjects * @return void */ - static function queryObjects(&$queryObjects) { - return self::singleton()->invoke(1, $queryObjects, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, 'civicrm_queryObjects'); + static function queryObjects(&$queryObjects, $type = 'Contact') { + return self::singleton()->invoke(2, $queryObjects, $type, self::$_nullObject, self::$_nullObject, self::$_nullObject, 'civicrm_queryObjects'); + } + + /** + * This hook is called while viewing contact dashboard + * + * @param array $availableDashlets list of dashlets; each is formatted per api/v3/Dashboard + * @param array $activeDashlets list of dashlets; each is formatted per api/v3/DashboardContact + */ + static function dashboard_defaults($availableDashlets, &$defaultDashlets) { + return self::singleton()->invoke(2, $availableDashlets, $defaultDashlets, self::$_nullObject, self::$_nullObject, self::$_nullObject, 'civicrm_dashboard_defaults'); } }