+ // CRM-12370
+ // 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;
+ }
+