) {
$this->commonBuildModuleList($fnPrefix);
-
+
return $this->runHooks($this->commonCiviModules, $fnSuffix,
$numParams, $arg1, $arg2, $arg3, $arg4, $arg5
);
) {
$result = $fResult = array();
- foreach ($civiModules as $module) {
- $fnName = "{$module}_{$fnSuffix}";
- if (function_exists($fnName)) {
- switch ($numParams) {
- case 0:
- $fResult = $fnName();
- break;
-
- case 1:
- $fResult = $fnName($arg1);
- break;
-
- case 2:
- $fResult = $fnName($arg1, $arg2);
- break;
-
- case 3:
- $fResult = $fnName($arg1, $arg2, $arg3);
- break;
-
- case 4:
- $fResult = $fnName($arg1, $arg2, $arg3, $arg4);
- break;
-
- case 5:
- $fResult = $fnName($arg1, $arg2, $arg3, $arg4, $arg5);
- break;
-
- default:
- CRM_Core_Error::fatal(ts('Invalid hook invocation'));
- break;
+ if ($civiModules !== NULL) {
+ foreach ($civiModules as $module) {
+ $fnName = "{$module}_{$fnSuffix}";
+ if (function_exists($fnName)) {
+ switch ($numParams) {
+ case 0:
+ $fResult = $fnName();
+ break;
+
+ case 1:
+ $fResult = $fnName($arg1);
+ break;
+
+ case 2:
+ $fResult = $fnName($arg1, $arg2);
+ break;
+
+ case 3:
+ $fResult = $fnName($arg1, $arg2, $arg3);
+ break;
+
+ case 4:
+ $fResult = $fnName($arg1, $arg2, $arg3, $arg4);
+ break;
+
+ case 5:
+ $fResult = $fnName($arg1, $arg2, $arg3, $arg4, $arg5);
+ break;
+
+ default:
+ CRM_Core_Error::fatal(ts('Invalid hook invocation'));
+ break;
+ }
}
- }
- if (!empty($fResult) &&
+ if (!empty($fResult) &&
is_array($fResult)) {
- $result = array_merge($result, $fResult);
+ $result = array_merge($result, $fResult);
+ }
}
}
foreach ($civiModules as $civiModule) {
if (!file_exists($civiModule['filePath'])) {
CRM_Core_Session::setStatus(
- ts( 'Error loading module file (%1). Please restore the file or disable the module.', array(1 => $civiModule['filePath']) ),
- ts( 'Warning'), 'error');
+ ts( 'Error loading module file (%1). Please restore the file or disable the module.', array(1 => $civiModule['filePath']) ),
+ ts( 'Warning'), 'error');
continue;
}
include_once $civiModule['filePath'];
/**
* This hook is called when API permissions are checked (cf. civicrm_api3_api_check_permission()
- * in api/v3/utils.php and _civicrm_api3_permissions() in CRM/Core/DAO/.permissions.php).
+ * in api/v3/utils.php and _civicrm_api3_permissions() in CRM/Core/DAO/permissions.php).
*
* @param string $entity the API entity (like contact)
* @param string $action the API action (like get)