浏览代码

Allow filtering of the languages to install

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@2713 a333f486-631f-4898-b8df-5754b55c2be0
dflaven 12 年之前
父节点
当前提交
08f5fe95c5
共有 1 个文件被更改,包括 8 次插入1 次删除
  1. 8 1
      setup/modelfactory.class.inc.php

+ 8 - 1
setup/modelfactory.class.inc.php

@@ -320,8 +320,9 @@ class ModelFactory
 	/**
 	 * Loads the definitions corresponding to the given Module
 	 * @param MFModule $oModule
+	 * @param Array $aLanguages The list of languages to process (for the dictionaries). If empty all languages are kept
 	 */
-	public function LoadModule(MFModule $oModule)
+	public function LoadModule(MFModule $oModule, $aLanguages = array())
 	{
 		try
 		{
@@ -395,6 +396,12 @@ class ModelFactory
 				
 				foreach ($this->aDict as $sLanguageCode => $aDictDefinition)
 				{
+					if ((count($aLanguages) > 0 ) && !in_array($sLanguageCode, $aLanguages))
+					{
+						// skip some languages if the parameter says so
+						continue;
+					}
+					
 					$oNodes = $this->GetNodeById('dictionary', $sLanguageCode, $this->oDictionaries);
 					if ($oNodes->length == 0)
 					{