diff --git a/setup/modelfactory.class.inc.php b/setup/modelfactory.class.inc.php index 14880065d..e7a3d0917 100644 --- a/setup/modelfactory.class.inc.php +++ b/setup/modelfactory.class.inc.php @@ -256,18 +256,21 @@ class MFModule public function GetDictionaryFiles() { $aDictionaries = array(); - if ($hDir = opendir($this->sRootDir)) + foreach (array($this->sRootDir, $this->sRootDir.'/dictionary') as $sRootDir) { - while (($sFile = readdir($hDir)) !== false) + if ($hDir = @opendir($sRootDir)) { - $aMatches = array(); - if (preg_match("/^[^\\.]+.dict.".$this->sName.'.php$/i', $sFile, - $aMatches)) // Dictionary files are named like .dict..php + while (($sFile = readdir($hDir)) !== false) { - $aDictionaries[] = $this->sRootDir.'/'.$sFile; + $aMatches = array(); + if (preg_match("/^[^\\.]+.dict.".$this->sName.'.php$/i', $sFile, + $aMatches)) // Dictionary files are named like .dict..php + { + $aDictionaries[] = $sRootDir.'/'.$sFile; + } } + closedir($hDir); } - closedir($hDir); } return $aDictionaries; @@ -466,18 +469,21 @@ class MFDictModule extends MFModule public function GetDictionaryFiles() { $aDictionaries = array(); - if ($hDir = opendir($this->sRootDir)) + foreach (array($this->sRootDir, $this->sRootDir.'/dictionary') as $sRootDir) { - while (($sFile = readdir($hDir)) !== false) + if ($hDir = @opendir($sRootDir)) { - $aMatches = array(); - if (preg_match("/^.*dictionary\\.itop.*.php$/i", $sFile, - $aMatches)) // Dictionary files are named like .dict..php + while (($sFile = readdir($hDir)) !== false) { - $aDictionaries[] = $this->sRootDir.'/'.$sFile; + $aMatches = array(); + if (preg_match("/^.*dictionary\\.itop.*.php$/i", $sFile, + $aMatches)) // Dictionary files are named like .dict..php + { + $aDictionaries[] = $sRootDir.'/'.$sFile; + } } + closedir($hDir); } - closedir($hDir); } return $aDictionaries; @@ -2898,4 +2904,4 @@ class MFParameters return $merged; } -} \ No newline at end of file +} diff --git a/setup/modulediscovery.class.inc.php b/setup/modulediscovery.class.inc.php index a77db0ecd..c57c047ed 100644 --- a/setup/modulediscovery.class.inc.php +++ b/setup/modulediscovery.class.inc.php @@ -134,17 +134,20 @@ class ModuleDiscovery { $sModuleName = $aMatches[1]; $sDir = dirname($sFilePath); - if ($hDir = opendir($sDir)) + foreach (array($sDir, $sDir.'/dictionary') as $sRootDir) { - while (($sFile = readdir($hDir)) !== false) + if ($hDir = @opendir($sRootDir)) { - $aMatches = array(); - if (preg_match("/^[^\\.]+.dict.$sModuleName.php$/i", $sFile, $aMatches)) // Dictionary files named like .dict..php are loaded automatically + while (($sFile = readdir($hDir)) !== false) { - self::$m_aModules[$sId]['dictionary'][] = self::$m_sModulePath.'/'.$sFile; + $aMatches = array(); + if (preg_match("/^[^\\.]+.dict.$sModuleName.php$/i", $sFile, $aMatches)) // Dictionary files named like .dict..php are loaded automatically + { + self::$m_aModules[$sId]['dictionary'][] = $sRootDir.'/'.$sFile; + } } + closedir($hDir); } - closedir($hDir); } } }