Enhancement: the default value for a module's parameter can now be specified (and altered) via the XML and will no longer reside in the configuration file.

SVN:trunk[3518]
This commit is contained in:
Denis Flaven
2015-03-25 15:11:24 +00:00
parent 166f5ce73f
commit 8b36699893
3 changed files with 293 additions and 3 deletions

View File

@@ -1150,9 +1150,20 @@ class Config
{
return $this->m_aModuleSettings[$sModule][$sProperty];
}
return $defaultvalue;
// Fall back to the predefined XML parameter, if any
return $this->GetModuleParameter($sModule, $sProperty, $defaultvalue);
}
public function GetModuleParameter($sModule, $sProperty, $defaultvalue = null)
{
$aAllParams = ModulesXMLParameters::GetData($sModule);
if(array_key_exists($sProperty, $aAllParams))
{
return $aAllParams[$sProperty];
}
return $defaultvalue;
}
public function SetModuleSetting($sModule, $sProperty, $value)
{
$this->m_aModuleSettings[$sModule][$sProperty] = $value;