X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FUtils%2FHook%2FDrupal.php;h=93b35e3871b716da8948c419aed0f7a7915cc35c;hb=a134e6ac6ffa73e67bb7f8da277734b9bd546121;hp=5b3e169cfde8b3dfdeda7ea2818d4d609c7b7785;hpb=9c70eb979d0c55a3f66e55e57e8610a28d3ab703;p=civicrm-core.git diff --git a/CRM/Utils/Hook/Drupal.php b/CRM/Utils/Hook/Drupal.php index 5b3e169cfd..93b35e3871 100644 --- a/CRM/Utils/Hook/Drupal.php +++ b/CRM/Utils/Hook/Drupal.php @@ -2,9 +2,9 @@ /* +--------------------------------------------------------------------+ - | CiviCRM version 4.4 | + | CiviCRM version 4.5 | +--------------------------------------------------------------------+ - | Copyright CiviCRM LLC (c) 2004-2013 | + | Copyright CiviCRM LLC (c) 2004-2014 | +--------------------------------------------------------------------+ | This file is a part of CiviCRM. | | | @@ -29,84 +29,10 @@ /** * * @package CiviCRM_Hook - * @copyright CiviCRM LLC (c) 2004-2013 + * @copyright CiviCRM LLC (c) 2004-2014 * $Id: $ * */ -class CRM_Utils_Hook_Drupal extends CRM_Utils_Hook { - - /** - * @var bool - */ - private $isBuilt = FALSE; - - /** - * @var array(string) - */ - private $allModules = NULL; - - /** - * @var array(string) - */ - private $civiModules = NULL; - - /** - * @var array(string) - */ - private $drupalModules = NULL; - - function invoke($numParams, - &$arg1, &$arg2, &$arg3, &$arg4, &$arg5, &$arg6, - $fnSuffix - ) { - - $this->buildModuleList(); - - return $this->runHooks($this->allModules, $fnSuffix, - $numParams, $arg1, $arg2, $arg3, $arg4, $arg5, $arg6 - ); - } - - /** - * Build the list of modules to be processed for hooks. - */ - function buildModuleList() { - if ($this->isBuilt === FALSE) { - if ($this->drupalModules === NULL) { - if (function_exists('module_list')) { - // copied from user_module_invoke - $this->drupalModules = module_list(); - } - } - - if ($this->civiModules === NULL) { - $this->civiModules = array(); - $this->requireCiviModules($this->civiModules); - } - - // we should add civicrm's module's just after main civicrm drupal module - // Note: Assume that drupalModules and civiModules may each be array() or NULL - if ($this->drupalModules !== NULL) { - foreach ($this->drupalModules as $moduleName) { - $this->allModules[$moduleName] = $moduleName; - if ($moduleName == 'civicrm') { - if (!empty($this->civiModules)) { - foreach ($this->civiModules as $civiModuleName) { - $this->allModules[$civiModuleName] = $civiModuleName; - } - } - } - } - } - else { - $this->allModules = (array) $this->civiModules; - } - - if ($this->drupalModules !== NULL && $this->civiModules !== NULL) { - // both CRM and CMS have bootstrapped, so this is the final list - $this->isBuilt = TRUE; - } - } - } +class CRM_Utils_Hook_Drupal extends CRM_Utils_Hook_DrupalBase { }