4 +--------------------------------------------------------------------+
5 | CiviCRM version 4.3 |
6 +--------------------------------------------------------------------+
7 | Copyright CiviCRM LLC (c) 2004-2013 |
8 +--------------------------------------------------------------------+
9 | This file is a part of CiviCRM. |
11 | CiviCRM is free software; you can copy, modify, and distribute it |
12 | under the terms of the GNU Affero General Public License |
13 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
15 | CiviCRM is distributed in the hope that it will be useful, but |
16 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. |
20 | You should have received a copy of the GNU Affero General Public |
21 | License and the CiviCRM Licensing Exception along |
22 | with this program; if not, contact CiviCRM LLC |
23 | at info[AT]civicrm[DOT]org. If you have questions about the |
24 | GNU Affero General Public License or the licensing of CiviCRM, |
25 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
26 +--------------------------------------------------------------------+
31 * @package CiviCRM_Hook
32 * @copyright CiviCRM LLC (c) 2004-2013
36 class CRM_Utils_Hook_Drupal
extends CRM_Utils_Hook
{
41 private $isBuilt = FALSE;
46 private $allModules = NULL;
51 private $civiModules = NULL;
56 private $drupalModules = NULL;
58 function invoke($numParams,
59 &$arg1, &$arg2, &$arg3, &$arg4, &$arg5,
63 $this->buildModuleList();
65 return $this->runHooks($this->allModules
, $fnSuffix,
66 $numParams, $arg1, $arg2, $arg3, $arg4, $arg5
71 * Build the list of modules to be processed for hooks.
73 function buildModuleList() {
74 if ($this->isBuilt
=== FALSE) {
75 if ($this->drupalModules
=== NULL) {
76 if (function_exists('module_list')) {
77 // copied from user_module_invoke
78 $this->drupalModules
= module_list();
82 if ($this->civiModules
=== NULL) {
83 $this->civiModules
= array();
84 $this->requireCiviModules($this->civiModules
);
87 $this->allModules
= array_merge((array)$this->drupalModules
, (array)$this->civiModules
);
88 if ($this->drupalModules
!== NULL && $this->civiModules
!== NULL) {
89 // both CRM and CMS have bootstrapped, so this is the final list
90 $this->isBuilt
= TRUE;