X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FUtils%2FHook.php;h=12e595fb5cce795ecf5424be3cb4fcc565685269;hb=f9585de5e5436d3909c1830543a50cf23fcccc79;hp=e486374055aa5b6188b9a865df52d7af44f530d2;hpb=d114ec7c93035ff930c310f9d3d2970dd7627d20;p=civicrm-core.git diff --git a/CRM/Utils/Hook.php b/CRM/Utils/Hook.php index e486374055..12e595fb5c 100644 --- a/CRM/Utils/Hook.php +++ b/CRM/Utils/Hook.php @@ -207,10 +207,11 @@ abstract class CRM_Utils_Hook { $this->commonIncluded = TRUE; $config = CRM_Core_Config::singleton(); - if (!empty($config->customPHPPathDir) && - file_exists("{$config->customPHPPathDir}/civicrmHooks.php") - ) { - @include_once "civicrmHooks.php"; + if (!empty($config->customPHPPathDir)) { + $civicrmHooksFile = CRM_Utils_File::addTrailingSlash($config->customPHPPathDir) . 'civicrmHooks.php'; + if (file_exists($civicrmHooksFile)) { + @include_once $civicrmHooksFile; + } } if (!empty($fnPrefix)) { @@ -2109,8 +2110,8 @@ abstract class CRM_Utils_Hook { * ); * $angularModules['myBigAngularModule'] = array( * 'ext' => 'org.example.mymod', - * 'js' => array('js/part1.js', 'js/part2.js'), - * 'css' => array('css/myAngularModule.css'), + * 'js' => array('js/part1.js', 'js/part2.js', 'ext://other.ext.name/file.js', 'assetBuilder://dynamicAsset.js'), + * 'css' => array('css/myAngularModule.css', 'ext://other.ext.name/file.css', 'assetBuilder://dynamicAsset.css'), * 'partials' => array('partials/myBigAngularModule'), * 'requires' => array('otherModuleA', 'otherModuleB'), * 'basePages' => array('civicrm/a'), @@ -2132,11 +2133,12 @@ abstract class CRM_Utils_Hook { * * @code * function example_civicrm_alterAngular($angular) { - * $angular->add(ChangeSet::create('mychanges') + * $changeSet = \Civi\Angular\ChangeSet::create('mychanges') * ->alterHtml('~/crmMailing/EditMailingCtrl/2step.html', function(phpQueryObject $doc) { * $doc->find('[ng-form="crmMailingSubform"]')->attr('cat-stevens', 'ts(\'wild world\')'); * }) * ); + * $angular->add($changeSet); * } * @endCode */ @@ -2380,4 +2382,18 @@ abstract class CRM_Utils_Hook { return self::singleton()->invoke(array('message'), $message, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, 'civicrm_inboundSMS'); } + /** + * This hook is called to modify api params of EntityRef form field + * + * @param array $params + * + * @return mixed + */ + public static function alterEntityRefParams(&$params, $formName) { + return self::singleton()->invoke(array('params', 'formName'), $params, $formName, + self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, + 'civicrm_alterEntityRefParams' + ); + } + }