- Fixed a typo

- New type of attributes that determines automatically the available languages (i.e. loaded dictionaries) for the application

SVN:trunk[446]
This commit is contained in:
Denis Flaven
2010-06-09 08:30:24 +00:00
parent 6dae6d378b
commit 0fea8f1ea0
2 changed files with 34 additions and 2 deletions

View File

@@ -680,6 +680,37 @@ class AttributeClass extends AttributeString
}
}
/**
* An attibute that matches one of the language codes availables in the dictionnary
*
* @package iTopORM
*/
class AttributeApplicationLanguage extends AttributeString
{
static protected function ListExpectedParams()
{
return parent::ListExpectedParams();
}
public function __construct($sCode, $aParams)
{
$this->m_sCode = $sCode;
$aAvailableLanguages = Dict::GetLanguages();
$aLanguageCodes = array();
foreach($aAvailableLanguages as $sLangCode => $aInfo)
{
$aLanguageCodes[$sLangCode] = $aInfo['description'].' ('.$aInfo['localized_description'].')';
}
$aParams["allowed_values"] = new ValueSetEnum($aLanguageCodes);
parent::__construct($sCode, $aParams);
}
public function RequiresIndex()
{
return true;
}
}
/**
* The attribute dedicated to the finalclass automatic attribute
*